0

Selenium newb here. I've had a very simple python script to fill out a questionnaire working for about 3 weeks. I just noticed it was getting stuck on the 3rd question today, and when I cleared cache and rebooted, Selenium seemingly can't find any element I try using Full or short XPATH on that page any longer.

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element:

I spent some time trying to match up ChromeDriver and Chrome Browser versions assuming that it auto-updated. However, I tested the same previously working script on a different website and it's working fine. So not sure if this small version difference is really the problem

Driver = 94.0.4606.61 Chrome = 94.0.4606.81

I checked for iframes, but can't seem to locate one under source or inspect. Here is the web form:

https://form.typeform.com/to/eUIsSKGd

I've been using hard.coded sleep since the beginning and it was working fine. I even extended the sleeps to exaggerate them, but still can't get past the "Start Button".

Here's the first snippet of the script that was working. Yes, I tried grabbing a fresh new XPATH

from selenium import webdriver
from selenium.webdriver.common.keys import Keys


driver = webdriver.Chrome()

driver.get('https://form.typeform.com/to/eUIsSKGd')



    time.sleep(5)

    #StartButton
    
    startbutton = driver.find_element_by_xpath('/html/body/div[3]/main/div[1]/div[2]/div/section/div[2]/div[1]/div')
    startbutton.click()

Please help

  • 1
    Might be worth looking into changing code to use [explicit or implicit waits](https://selenium-python.readthedocs.io/waits.html). That would take care of the timing issue with page load. If that doesn't solve it, then it's gotta be an issue with the xpath. Maybe consider targeting a class name, you could use a css selector for that and even do a [partial match](https://www.w3schools.com/cssref/sel_attr_begin.asp) – SeaChange Oct 19 '21 at 01:03
  • Thanks but no luck with either. I think this site might be using something to obscure itself from Selenium . ### from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome() driver.implicitly_wait(5) driver.get('https://form.typeform.com/to/eUIsSKGd') time.sleep(5) #StartButton driver.find_element_by_css_selector("SubmitWrapper[id^='SubmitWrapper_']") ### selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: – mo_rada Oct 19 '21 at 18:22
  • The Forms conveniently allow for Keystrokes to answer the questions (ENTER, Y, N ) but as I understand it, the Chromedriver can't perform 'send_keys' without it 'Getting' or Locating an Element on the page first. This is when I realized that none of the Functions I'm conjuring up work on this Webpage. Any thoughts ? – mo_rada Oct 19 '21 at 18:25
  • Anyone else having this issue? I now realize that no Selenium functions designed to find elements are working on this page, but work on other sites. I even tried rolling bac Chrome and the Chromedriver versions. – mo_rada Dec 08 '21 at 20:26

0 Answers0