With requests will not give because it does not process Javascript, if you do:
import requests
req = requests.get("http://soulegal.byethost7.com/wp/2016/07/28/pesquisa-eu-sou-legal/")
print(req.status_code)
print(req.text)
You can see what you print:
200
... This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support ...
This basically tells us that the request was successful (code 200) but that we need a browser, or something that processes javascript implicitly (I do not know). However good programmers have developed a module called Selenium that does it all automatically (open browser, select, submit the form, ect ...). And a well structured documentation :
To vote on several options:
from selenium import webdriver
driver = webdriver.Firefox()
opts = ['poll-answer-6', 'poll-answer-7', 'poll-answer-8'] # id das opcoes em que deseja votar
for i in opts:
driver.get("http://soulegal.byethost7.com/wp/2016/07/28/pesquisa-eu-sou-legal/?ckattempt=1")
opt = driver.find_element_by_id(i) # selecionamos o elemento com id
opt.click()
btn_submit = driver.find_element_by_name('vote') # selecionamos o elemento que como name tem 'vote', o nosso botao
btn_submit.click()
print('Votou em {}'.format(driver.find_element_by_css_selector('label[for="' +i+ '"]').text))
To select the same option several times, in this case 5 times:
from selenium import webdriver
driver = webdriver.Firefox()
opt = 'poll-answer-7' # id opcao em que deseja votar
votos = 5
for i in range(votos):
driver.get("http://soulegal.byethost7.com/wp/2016/07/28/pesquisa-eu-sou-legal/?ckattempt=1")
opt_ele = driver.find_element_by_id(opt)
opt_ele.click()
btn_submit = driver.find_element_by_name('vote')
btn_submit.click()
opt_text = driver.find_element_by_css_selector('label[for="' +opt+ '"]').text
print('Votou em {} {} vezes'.format(opt_text, votos))