Search code examples
pythonjavaseleniumautomationselenium-chromedriver

Cannot get Selenium to access a certain class


I am just working with Selenium to automate some simple tasks at work. I am unable to get it to access this class:

<a class="qx-nav-name qx-nav-ellipsis" href="javascript:openInIFrame('iamain', 'company_migration.phtml%3f.sess%3dZcv4vINlw4RYZSvCGO7K_wW_hFllTmXLo2dmelAVWGUrwhjuyvEYo4RY%26.ifmod%3dco%26.done%3dY5F7ZfgEOSSVJqglLXtQhgAAAAw28%26eSecReq%3dS0VZX1NFQzpDUENvc2xicXhiYlN6Z1UxL280SjBjYjR0UW1yZ2xVOHFTRU1PQTRjVi9rPQ..%26.op%3d258&amp;.menuItemRefNo=0')">Import data</a>

This is the code I am using `

driver.find_element(By.CSS_SELECTOR, '.qx-nav-name.qx-nav-ellipsis').click()

`


Solution

  • Try using below code

    driver.find_element(By.Link_Text, 'Import data').click()