我想登录Facebook Messenger并解析HTML。
import requests
from bs4 import BeautifulSoup
import webbrowser
page = requests.get("https://www.messenger.com", auth=
('username', 'password'))
soup = BeautifulSoup(page, 'html.parser')
print(soup)
我是从另一个堆栈问题中得到这个的,但它给了我一个错误:
File "C:/Code/Beautiful Soup Web Scraping.py", line 7, in <module>
soup = len(BeautifulSoup(page, 'html.parser'))
File "C:\Users\Ethan\AppData\Local\Programs\Python\Python37\lib\site-packages\bs4\__init__.py", line 246, in __init__
elif len(markup) <= 256 and (
TypeError: object of type 'Response' has no len()
我怎样才能让它工作?