Alejandro Simkievich Alejandro Simkievich - 1 year ago 94
Python Question

python - having a hard time on selenium to click on buton

I am working with selenium (python) and I would like for it to click on a button. The code goes something like this:

from selenium import webdriver
driver = webdriver.Firefox()


Nothing at all happens. I do

html_source = driver.page_source

and inspect the source, and I am pretty sure this is the element I want to find:

<input class="ksb _kvc" value="Mais resultados" id="smb" data-lt="Carregando..." jsaction="str.smr" data-ved="0ahUKEwjPtK6Fwv3PAhVGI5AKHTkSDVsQxdoBCE8" type="button" />

Any help is much appreciated.

Answer Source

Have you tried


Rather than


I suspect nothing happens because an exception is thrown in your original code if the find fails. When attempting to locate elements I would usually use id/name as these are normally unique. For a full list see

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download