How to search a webpage using selenium by any of the keywords inputted?

后端 未结 2 1494
我寻月下人不归
我寻月下人不归 2021-01-26 21:48

I am new to selenium in python. I am searching the supreme website by keywords using Xpath as such:

WebDriverWait(driver, 5).until(EC.element_to_be_clickable(
           


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-26 22:23

    You can use XPath to solve this by looking for sibling tags. For example, if you want to find the Dragon Tee Heather Grey link, you can use this.

    driver.find_element_by_xpath('//div[a/text() = "Dragon Tee"]/following-sibling::div[a/text() = "Heather Grey"]')
    

提交回复
热议问题