Trying to access certain text properties that are nested. Have had no trouble with most elements, but just haven't been able to get a certain few.
I'm trying to set: one variable = Optomi, another variable = Detroit, Michigan, United States (Although I feel like once I have the first variable, I can get the second fairly easy)
<a data-control-name="company_link" href="/company/optomi/life/" id="ember2228" class="jobs-details-top-card__company-url ember-view"> Optomi </a>
I'm trying to just pull out the text value "Optomi".
I've tried:
cname = self.driver.find_elements_by_xpath("//a[@class='jobs-details-top-card__company-url ember-view']/a")
print(cname)
and
cname = self.driver.find_elements_by_css_selector(
"div.jobs-details-top-card__company-info t-14 t-black--light t-normal mt1")
print(cname)
print(cname.get_attribute("text"))
Any tips?