python提取网页的url代码
实例代码import re
import urllib
url="http://www.ite5e.com"
s=urllib.urlopen(url).read()
ss=s.replace(" ","")
urls=re.findall(r"<a.*?href=.*?</a>",ss,re.I)
for i in urls:
print i
else:
print this is over
补充:Web开发 , Python ,
import re
import urllib
url="http://www.ite5e.com"
s=urllib.urlopen(url).read()
ss=s.replace(" ","")
urls=re.findall(r"<a.*?href=.*?</a>",ss,re.I)
for i in urls:
print i
else:
print this is over
补充:Web开发 , Python ,