How to select element using XPATH syntax on Selenium for Python?

前端 未结 2 469
醉酒成梦
醉酒成梦 2020-12-09 02:42

consider following HTML:

abc

I want t

2条回答
  •  甜味超标
    2020-12-09 02:55

    HTML

    abc

    You could use the XPATH as :

    //div[@id='a']//a[@class='click']
    

    output

    abc
    

    That said your Python code should be as :

    driver.find_element_by_xpath("//div[@id='a']//a[@class='click']")
    

提交回复
热议问题