小编Bry*_*yan的帖子

BeautifulSoup:'Response'类型的对象没有len()

问题:当我尝试执行脚本时,BeautifulSoup(html, ...)给出错误消息"TypeError:类型'对象的对象'没有len().我尝试将实际的html作为参数传递,但它仍然不起作用.

import requests

url = 'http://vineoftheday.com/?order_by=rating'
response = requests.get(url)
html = response.content

soup = BeautifulSoup(html, "html.parser")
Run Code Online (Sandbox Code Playgroud)

html python parsing beautifulsoup web-scraping

20
推荐指数
4
解决办法
3万
查看次数

标签 统计

beautifulsoup ×1

html ×1

parsing ×1

python ×1

web-scraping ×1