I'm trying to get this element with Python and Selenium.
<h2 class="jobTitle jobTitle-color-purple">
<span title="Director">Director=</span>
<h2>
This is what I tried:
try:
title = job.find_element_by_xpath('.//td[@class="title"]//a').text
except:
title = job.find_element_by_xpath('.//h2[@class="title"]//a').get_attribute(name="title")
What am I doing wrong?
no such element: Unable to locate element: {"method":"xpath","selector":".//h2[@class="title"]//a"}