We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6e299f commit f467a62Copy full SHA for f467a62
remove_all_pyc.md 01_remove_all_pyc.mdremove_all_pyc.md renamed to 01_remove_all_pyc.md
02_find_all_links.py
@@ -0,0 +1,18 @@
1
+import urllib2
2
+import re
3
+
4
+# get url
5
+url =raw_input('Enter a URL (include `http://`): ')
6
7
+# connect to the url
8
+website = urllib2.urlopen(url)
9
10
+# read html
11
+html = website.read()
12
13
+# use re.findall to grab all the links
14
+links = re.findall('"((http|ftp)s?://.*?)"', html)
15
16
+# output links
17
+for link in links:
18
+ print link[0]
readme.md
@@ -1,3 +1,4 @@
## Just another repo of Python scripts
-1. **remove_all_pyc.md**: remove all *.pyc* files from a git repo
+1. **01_remove_all_pyc.md**: remove all *.pyc* files from a git repo
+2. **02_find_all_links.py**: get all links from a webpage
0 commit comments