Answer the question
In order to leave comments, you need to log in
Throws an error when trying to select elements with Selenium for Python?
here is the code:
driver.find_element_by_xpath("//*[@id="courses"]/tbody/tr[12]/td[3]/a").click()
driver.find_element_by_xpath("//*[@id="courses"]/tbody/tr[12]/td[3]/a").click() ^
SyntaxError: invalid syntax
Answer the question
In order to leave comments, you need to log in
Because you have double quotes in double quotes. They must either be escaped or written like this: '//*[@id="courses"]/tbody/tr[12]/td[3]/a'
Read at least about the syntax, or something.
And yes, why are you using selenium if you control it through pyautogui anyway? Why methods like send_keys did not please you?
PS The code is not allowed to spread in the form of screenshots, only the text wrapped in a special tag.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question