Как я могу использовать select_form и .form для того, чтобы go перейти на домашнюю страницу yelp, найти панель поиска, набрать 'Ужин' и вернуть результат?
import mechanize
import re
br = mechanize.Browser()
br.set_handle_robots(False)
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
response = br.open('https://www.yelp.com')
br.select_form(nr=0)
br.form['find_desc'] = 'Dinner' # This is where my issue is
data = br.submit()
print(data)
#prints <response_seek_wrapper at 0x37fde10 whose wrapped object = <closeable_response at 0x3e8c5d0 whose fp = <_io.BufferedReader name=904>>>
for control in br.form.controls:
print(control)
# prints <TextControl(find_desc=)> <TextControl(find_loc=Irvine, CA)> <HiddenControl(ns=1) (readonly)> <SubmitButtonControl(<None>=submit) (readonly)>
for form in br.forms():
print(form.name)
# prints None