2

I want to get the text within a var tag which lies within a pseudo class: ::before ... <var class="added">Element</var> .. ::after

I tried How locate the pseudo-element ::before using Selenium Python And also the usual ways like:

x = driver.find_elements_by_class_name("added")

elem = [i.text for i in x]

Or trying to access it via the parent element. I always get an empty list as a result. Does anyone here have an idea what I´m doing wrong?

Thanks a lot!

MaxFrost
  • 91
  • 6
  • This sounds like an [X-Y problem](http://xyproblem.info/). Instead of asking for help with your solution to the problem, edit your question and ask about the actual problem. What are you trying to do? – undetected Selenium Apr 19 '22 at 19:25
  • Not sure if my edit solved the issue you´re pointing out. Maybe I don´t understand my own underlying problem that I´m trying to solve. – MaxFrost Apr 19 '22 at 19:32

1 Answers1

0

Have you tried beautiful soup instead of selenium? This may be a bad workaround but it helped me in many such cases.

Ethyl
  • 87
  • 7