爬虫教程里打印不出来
>>> import requests>>> import bs4
>>> res = requests.get("https://movie.douban.com/top250")
>>> soup = bs4.BeautifulSoup(res.text, "html.parser")
>>> targets = soup.find_all("div", class_="hd")
>>> for each in targets:
print(each.a.span.text)
爬取豆瓣TOP250电影排行榜(有彩蛋)
https://fishc.com.cn/thread-94979-1-1.html
(出处: 鱼C论坛)
不知道什么问题一直什么都不出现?(print(each.a.span.text)这句复制过来缩进自己没了)
https://fishc.com.cn/thread-155756-1-1.html
页:
[1]