I'm trying to use find_element_by_class_name
where the class has spaces and it does not work:
Here is the code:
<a class="yt-simple-endpoint style-scope yt-formatted-string" href="/user/santanderbrasil">Santander Brasil</a>
I want the get the content "Santander Brasil"
I tried the following:
driver.find_element_by_class_name("yt-simple-endpoint.style-scope.yt-formatted-string")
driver.find_element_by_class_name("a.yt-simple-endpoint.style-scope.yt-formatted-string")
and
driver.find_element_by_class_name("a.yt-simple-endpoint.")
none of the worked...
Any help?
Use the css selector function instead.
driver.find_element_by_css_selector("a.yt-simple-endpoint.style-scope.yt-formatted-string")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With