python爬取页面上的链接
python爬取豆瓣网上的链接
import urllib
from bs4 import BeautifulSoup
response = urllib.urlopen('https://www.douban.com/')
bsObj = BeautifulSoup(response, 'html.parser')
a = bsObj.find_all('a')
for b in a:
c = b.get('href')
print(c)
python爬取豆瓣网上的链接
import urllib
from bs4 import BeautifulSoup
response = urllib.urlopen('https://www.douban.com/')
bsObj = BeautifulSoup(response, 'html.parser')
a = bsObj.find_all('a')
for b in a:
c = b.get('href')
print(c)