'How to click on the E-Paper link of the first left element using Selenium Python

I used chrome inspect>select an element in the page then select it and copy xpath address

and in python use it for click in element but just refresh page and not work

Website url: https://zeitung.faz.net/

and I need to click on E-Paper using xpath:

driver.find_element_by_xpath("/html/body/main/div[1]/div/div[1]/div[2]/ul/li[1]/div[1]/div[2]/a[2]").click()

But not click.



Solution 1:[1]

Try either of the following:

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, "E-Paper"))).click()

or

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[normalize-space()='E-Paper']"))).click()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 undetected Selenium