[Python] python通过正则获取网页上的全部链接 →→→→→进入此内容的聊天室

来自 , 2019-04-30, 写在 Python, 查看 120 次.
URL http://www.code666.cn/view/faad9525
  1. import re, urllib
  2. htmlSource = urllib.urlopen("http://www.sharejs.com").read(200000)
  3. linksList = re.findall('<a href=(.*?)>.*?</a>',htmlSource)
  4. for link in linksList:
  5.     print link

回复 "python通过正则获取网页上的全部链接"

这儿你可以回复上面这条便签

captcha