I need to click a button on quora but dont know how

60 views Asked by At

I am trying to make this thing where a bot can answer questions on quora. But while creating this I ran into a problem with clicking on the answer button. It just wouldn't work. Anyone some kind of advice?

1

There are 1 answers

1
Thomas Péan On

You can use selenium to click a button in python.

Example:

from selenium import webdriver

driver = webdriver.Chrome(chrome_options=options)
driver.get('http://codepad.org')

python_button = driver.find_elements_by_xpath("//input[@name='lang' and @value='Python']")[0]
python_button.click()

Hope it was usefull

Edit:

You can get the XPath of an element by copying it from the console (when inspecting the element)

try it