【发布时间】:2016-08-11 02:05:49
【问题描述】:
问题:当我尝试执行脚本时,BeautifulSoup(html, ...) 给出错误消息“TypeError:'Response' 类型的对象没有 len()。我尝试将实际的 html 作为参数传递,但它仍然没有”没用。
import requests
url = 'http://vineoftheday.com/?order_by=rating'
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html, "html.parser")
【问题讨论】:
-
你用的是什么版本的beautifulsoup?这似乎对我有用
标签: python html parsing web-scraping beautifulsoup