Element is found in XPath Checker but not in Selenium

前端 未结 4 597
庸人自扰
庸人自扰 2021-01-14 18:29

I have the following XPath:

//div[contains(@id, \'box\')]/div/h4/small/a[contains(@href, \'google\')]/@href

When I try out this XPath in XP

4条回答
  •  暖寄归人
    2021-01-14 19:18

    According to the API doc, it should be

    ...getAttribute("xpath=//div[contains....
    

提交回复
热议问题