Once I obtain an href
through the use of Selenium in Python.
Is there a way to find the XPath
based on that href
and click on that XPath
?
For Example:
href = '/sweatshirts/vct65b9ze/yn2gxohw4'
How would I find the XPath
on that page?
Once I obtain an href
through the use of Selenium in Python.
Is there a way to find the XPath
based on that href
and click on that XPath
?
For Example:
href = '/sweatshirts/vct65b9ze/yn2gxohw4'
How would I find the XPath
on that page?
When the element is for instance a link, you can use the following code:
driver.find_element_by_xpath('//a[@href="/sweatshirts/vct65b9ze/yn2gxohw4"]');