python – Xpath wrong in selenium
Regarding the tbsCertificate error, add the below line: This will ignore those errors.
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
Coming to your next issue, which is trying to locate the “Keywords” element. Try this Xpath expression:
(//div[@id='research-link']//span)[1]
Code should be:
element = WebDriverWait(driver,30).until(EC.presence_of_element_located((By.XPATH, "(//div[@id='research-link']//span)[1]")))
element.click()
Or:
WebDriverWait(driver,30).until(EC.element_to_be_clickable((By.XPATH, "(//div[@id='research-link']//span)[1]")))
element.click()
You can even try using below XPath expression:
This expression searches all the span nodes which contain text “Keywords”
//span[text()='Keywords']
Read more here: Source link
