Forums

Selenium click() doesn't work sometimes

Hi! i was trying to scrape twitter in pythonanywhere and had this error, in my local it works perfectly, but here i have a lot of errors. I tried .click() and EC.element_to_be_clickable(), also tried time.sleep() and driver.implicitly_wait(), but nothing changes. If someone knows how to make it work, i really appreciate it. Thanks in advance.

I had experienced problems with selenium click and sometimes using js to click with execute_script("arguments[0].click();", self) method on element helped.

JS way did not work for me. Click executes fine via a local server. Any other ideas?

Do you have the same issue when using element_to_be_clickable() before clicking?

Yes, the issue continues. I get TimeoutException

I suggest inspecting what is the state of the page and if the element you want to click is present, as the page may behave differently when accessed from a cloud environment.