python正则表达式提取网页URL
import re import urllib url="http://www.open-open.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'
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/8307.html