HTML
<div id='a'>
<div>
<a class="click">abc</a>
</div>
</div>
You could use the XPATH as :
//div[@id='a']//a[@class="click"]
output
<a class="click">abc</a>
That said your Python code should be as :
driver.find_element_by_xpath("//div[@id='a']//a[@class="click"]")
Related Contents:
- selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element while trying to click Next button with selenium
- Select iframe using Python + Selenium
- StaleElementException when iterating with Python
- Unable to locate element using selenium chrome webdriver in python selenium
- Selenium Compound class names not permitted
- Selenium not able to click on Get Data button on using Python
- Python Selenium WebDriver. Writing my own expected condition
- Clicking on svg using selenium python
- selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable with Selenium and Python
- How to find element by part of its id name in selenium with python
- SyntaxError: Failed to execute ‘evaluate’ on ‘Document’: The string ‘//img[contains(‘1236548597′)]’ is not a valid XPath expression
- ElementClickInterceptedException: Message: element click intercepted: Element is not clickable with Selenium and Python
- NoSuchElementException: Message: Unable to locate element while trying to click on the button VISA through Selenium and Python
- “selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element” while clicking a ‘Next’ button with Selenium
- Python Selenium – get href value
- How to click on Load More button within Google Trends and print all the titles through Selenium and Python
- How to retrieve partial text from a text node using Selenium and Python
- selenium – Failed to execute ‘evaluate’ on ‘Document’: The string is not a valid XPath expression
- Selenium – wait until element is present, visible and interactable
- How to open a Chrome Profile through Python
- How do I run Selenium in Xvfb?
- How can I select a html element no matter what frame it is in in selenium?
- How to get attribute of element from Selenium?
- Change ChromeOptions in an existing webdriver
- Selenium waitForElement
- How to take partial screenshot with Selenium WebDriver in python?
- Is it possible to hide the browser in Selenium RC?
- How to set the timeout of ‘driver.get’ for python selenium 3.8.0?
- How to download XML files avoiding the popup This type of file may harm your computer through ChromeDriver and Chrome using Selenium in Python
- Selenium Webdriver: How to Download a PDF File with Python?
- Downloading a file at a specified location through python and selenium using Chrome driver
- Python webdriver to handle pop up browser windows which is not an alert
- Python selenium multiprocessing
- ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
- How to open a link embeded in a webelement with in the main tab, in a new tab of the same window using Control + Click of Selenium Webdriver
- How to get path of an element in lxml?
- DeprecationWarning: use options instead of chrome_options error using ChromeDriver and Chrome through Selenium on Windows 10 system
- Selenium gives “selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary” on Mac
- Chromedriver only supports characters in the BMP error while sending Emoji with ChromeDriver Chrome using Selenium Python to Tkinter’s label() textbox
- How to get rid of the infobar “Chrome is being controlled by automated test software” through Selenium
- FileNotFoundError: [Errno 2] No such file or directory: ‘geckodriver’: ‘geckodriver’ with GeckoDriver and Python in MAC OS
- How to click a link by text with No Text in Python
- How to read text that is under #shadow-root (user-agent)
- Evade detection of selenium automation
- How to fix python-selenium error “connection refused” when initializing a selenium webdriver?
- How do I get current URL in Selenium Webdriver 2 Python?
- Selenium headless: How to bypass Cloudflare detection using Selenium
- Python: use cookie to login with Selenium
- Getting all visible text from a webpage using Selenium
- selenium.common.exceptions.ElementNotVisibleException: Message: element not visible while trying to access an element with Python + Selenium