This is my first question so if I missed some information or did anything wrong I already apologize for that. I am using a ChromeDriver to scrape through the Internet. The used language is Python in combination with Selenium.
I have an element which is a span tag that I stored in a variable called elem. I could find the parent element of elem
articles.append(elem.find_parent("a")['href'])
which was stored in that array articles. Now I need to find the ancestor element which is the span tag with the class saying "price": lowest line represents elem and the second line is the element I am looking for.
However, trying the same like before:
elem.find_parent("span")['class']
doesn't work out for me and I get a Nonetype Error. I have tried multiple other methods but always got a NoneType Error.
Thank you in advance.