1 import re
 2 import urllib
 3 url="http://www.itokit.com"
 4 s=urllib.urlopen(url).read()
 5 ss=s.replace(" ","")
 6 urls=re.findall(r"<a.*?href=.*?<\/a>",ss,re.I)
 7 for i in urls:
 8 print i
 9 else:
10 print 'this is over'

挺好用的,记录下

相关文章:

  • 2022-02-12
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2021-11-13
  • 2021-06-10
  • 2021-11-11
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案