'Python Selenium get "sold items" information from eBay Productpage

I want to click on the following element "23 verkauft" on an eBay productpage you can see it on this screenshot:

Element to click on

Here is the HTMl Code of this Element:

HTMl Code

Here is my Code but the webdriver cant locate the element or can't click on it.

sold = WebDriverWait(driver, 10).until(
                    EC.presence_of_element_located((By.XPATH, "//span[@class, 'vi-txt-underline']")))
sold.click()


Solution 1:[1]

You have an error with your locator.
Instead of

//span[@class, 'vi-txt-underline']

It should be

//a[@class='vi-txt-underline']

Also instead of presence_of_element_located you should use visibility_of_element_located since the former method will wait for more mature element state, not only presented on the page but also visible.
Also you can click on the element there directly, no need for the additional code line.
So your code could be

WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, "//a[@class='vi-txt-underline']"))).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 Prophet