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

来自 , 2019-05-22, 写在 Python, 查看 101 次.
URL http://www.code666.cn/view/154ff894
  1. import urllib
  2. import BeautifulSoup
  3.  
  4. htmlSource = urllib.urlopen("http://sebsauvage.net/index.html").read(200000)
  5. soup = BeautifulSoup.BeautifulSoup(htmlSource)
  6. for item in soup.fetch('a'):
  7.     print item['href']
  8. #//python/208

回复 "python通过BeautifulSoup抓取网页上的全部链接"

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

captcha