Your xpath starts with a slash (/
) and is therefore absolute. Add a dot (.
) in front to make it relative to the current element i.e.
links = table.xpath(".//a[contains(@href, 'http://www.example.com/filter/')]")
More Related Contents:
- How to get path of an element in lxml?
- How do I use a default namespace in an lxml xpath query?
- How to use regular expression in lxml xpath?
- Extracting lxml xpath for html table
- Why does this xpath fail using lxml in python?
- Why doesn’t xpath work when processing an XHTML document with lxml (in python)?
- Error while installing lxml through pip: Microsoft Visual C++ 14.0 is required
- Using Python Iterparse For Large XML Files
- How to install lxml on Ubuntu
- how to remove an element in lxml
- Selenium not able to click on Get Data button on using Python
- bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml. Do you need to install a parser library?
- Remove namespace and prefix from xml in python using lxml
- Building lxml for Python 2.7 on Windows
- Python pretty XML printer with lxml
- Python Selenium – get href value
- ElementClickInterceptedException: Message: element click intercepted: Element is not clickable with Selenium and Python
- How to retrieve partial text from a text node using Selenium and Python
- Using XPath in ElementTree
- How can I get all the plain text from a website with Scrapy?
- Parse SGML with Open Arbitrary Tags in Python 3
- ElementNotInteractableException: Message: element not interactable error sending text in search field using Selenium Python
- selenium two xpath tests in one
- How to find element by part of its id name in selenium with python
- lxml etree xmlparser remove unwanted namespace
- python – lxml: enforcing a specific order for attributes
- How to include the namespaces into a xml file using lxml?
- How to select element using XPATH syntax on Selenium for Python?
- Find element by text with XPath in ElementTree
- Why is lxml.etree.iterparse() eating up all my memory?