我正在制作一个 webscraper 来登录一个网站,当我登录时,我收到了一个我不知道如何解决的 beautifulSoup 错误,以及一个我也很困惑的对象错误。我一直在看网络抓取教程一段时间,真的需要帮助
from robobrowser import RoboBrowser
browser = RoboBrowser()
login_url = 'http://netacad.com/login'
browser.open(login_url)
form = browser.get_form(id='f')
form['username'].value = "username"
form['password'].value = "password"
browser.submit_form(form)
错误
The code that caused this warning is on line 10 of the file C:\Program Files (x86)\Wing IDE 101 6.0\bin\wingdb.py. To get rid of this warning, change code that looks like this:
BeautifulSoup(YOUR_MARKUP})
to this:
BeautifulSoup(YOUR_MARKUP, "html.parser")
markup_type=markup_type))
Traceback (most recent call last):
File "C:/Users/Leon/Desktop/retrieve.py", line 6, in <module>
form['username'].value = "username"
builtins.TypeError: 'NoneType' object is not subscriptable