我正在做一个网络爬行器来登录一个网站,当我登录的时候,我收到了一个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发布于 2017-08-17 03:03:27
试试看:
browser = RoboBrowser(parser='html.parser')https://stackoverflow.com/questions/44698274
复制相似问题