Here is my Splinter code -
b = Browser()
b.visit("http://boingboing.net")
b.fill("q", "OpenXC")
At this point, I would like to press "Enter" for the search to happen.
This is very similar to the example in the Splinter tutorial page. In this instance, there is really no button element present.
I see that this Search box is a Google Search Box with an id "cse-search-box". I do not know how to trigger search here.
Can you please help?
Metaphy's (thanks, btw) code below generates a traceback for me -
Traceback (most recent call last): File "/Users/muthu/Desktop/boing.py", line 5, in b.execute_script('document.getElementsByName("f")[0].submit()') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/splinter/driver/webdriver/init.py", line 58, in execute_script self.driver.execute_script(script) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 397, in execute_script {'script': script, 'args':converted_args})['value'] File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 165, in execute self.error_handler.check_response(response) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 158, in check_response raise exception_class(message, screen, stacktrace) WebDriverException: Message: u'waiting for evaluate.js load failed' ; Stacktrace: at r (file:///var/folders/5r/06jrtyyn2kd8ty05m71lm0hr0000gn/T/tmpBFCIVe/extensions/[email protected]/components/driver_component.js:8360) at fxdriver.Timer.prototype.runWhenTrue/g (file:///var/folders/5r/06jrtyyn2kd8ty05m71lm0hr0000gn/T/tmpBFCIVe/extensions/[email protected]/components/driver_component.js:392) at fxdriver.Timer.prototype.setTimeout/<.notify (file:///var/folders/5r/06jrtyyn2kd8ty05m71lm0hr0000gn/T/tmpBFCIVe/extensions/[email protected]/components/driver_component.js:386)
I can not access the http://boingboing.net site, so I take baidu.com for example:
New answer: