Reputation: 1
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?
Upvotes: -2
Views: 55
Reputation: 29
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)
Upvotes: 0