0
我正在做webscraper登录到一个网站,当我登录我收到beautifulSoup错误,我不知道如何解决,以及对象错误,我也感到困惑。我一直在看网页教程刮了一会儿,真正需要帮助的Robobrowser 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
你得到什么错误?如果你没有清楚地解释你的问题,人们会如何帮助你? –
我真的很笨,哈哈真的很深夜。当我回家时我会放下它 – leon