Pregunta

How can I click the link:

<a class="single_like_button btn3-wrap" onclick="openFbLWin_189932();">
<span>&nbsp;</span><div class="btn3">Share</div>
</a>

This is my code in Python, but it doesn't work. I use Selenium

......
elem = self.driver.find_elements_by_class_name("single_like_button btn3-wrap")[0].click(); 
......
¿Fue útil?

Solución

find_elements_by_class_name() is apparently limited to a single class name.

You can use find_element_by_css_selector() instead and write:

self.driver.find_element_by_css_selector(
    ".single_like_button.btn3-wrap").click();
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top