0

Im getting the following error while using selenium im combination with python:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/main/article/section/form/div[1]/div[2]/div/div/div/div/div/div/input"}

My python script looks like this:

from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
import time 
import random
import string 


driver = webdriver.Chrome("D:\Programmieren\Python\Python\pybo\chromedriver.exe")
driver.get("https://www.langenscheidt.com/jugendwort-des-jahres")
time.sleep(10)

driver.find_element_by_xpath("/html/body/main/article/section/form/div[1]/div[2]/div/div/div/div/div/div/input")

And the targets html like this:

<input aria-labelledby="question-title-463803684" id="463803684" aria-required="true" data-sm-open-single="true" class="wds-input wds-input--lg qt-input_text text" name="463803684" size="100" value="">

1 Answers1

0

So i checked the website, and the form that you want to fill out is included(embedded) html which means there are tags inside another pair of tags. I do not know how to parse this but if you just want to fill out that form there is a separate URL to it:

https://www.surveymonkey.com/r/7JZRVLJ.

This is the same form just not embedded into the previous website. You can use this URL for your selenium automation.

Adam. A.
  • 68
  • 2
  • 6