python - Selenium: why would "send_keys(Keys.RETURN)" work when "click()" doesn't? -
i have element corresponding button (the bing search button, precise) , responds , works to:
button.send_keys(keys.return)
but when try:
button.click()
it give me "\'\'undefined\' not object". can offer , explanation on this? if relevant, i'm using phantomjs browser, , have text entered search field.
i got code work on mac, won't run on ubuntu server. might important.
what seems causing problem when come in text bing search bar, bar expands , button moved right substantial amount. still, why click method not work when sending homecoming key work?
sometimes might happen. try:
check selector! maybe other elements have same class (for example), utilize find_element_by_class_name
, forks singleton element. check trace-back more.
ajax issues. web-sites uses lot of js , takes time request or click not working reasons.
due previous problem, seek click on element javascript. if possible, seek driver.execute_script()
method it.
python ubuntu selenium phantomjs
No comments:
Post a Comment