I've been at this for literally a day; none of the Youtube videos go beyond a very basic example. Please help. I'm sure Im missing something really basic here.
Would it change things if the input boxes are embedded in a table? Here is my code:
from robobrowser import RoboBrowser
br = RoboBrowser(history=True, parser = 'html.parser', user_agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11')
br.open('https://fbcad.org/Advanced-Search')
form = br.get_form(id='Form')
form['NameFirst'] = "john"
form['NameLast'] = "smith"
br.submit_form(form)
here is the error:
C:\Python\Python37\python.exe C:/Python/Python37/FBCAD.py
Traceback (most recent call last):
File "C:/Python/Python37/FBCAD.py", line 7, in <module>
form['NameFirst'] = "john"
File "C:\Python\Python37\lib\site-packages\robobrowser\forms\form.py", line 216, in __setitem__
self.fields[key].value = value
File "C:\Python\Python37\lib\site-packages\werkzeug\datastructures.py", line 784, in __getitem__
raise exceptions.BadRequestKeyError(key)
werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.