Skip to content

Instantly share code, notes, and snippets.

@nenodias
Last active November 5, 2015 11:26
Show Gist options
  • Save nenodias/e6c2b94d7004efad9f9e to your computer and use it in GitHub Desktop.
Save nenodias/e6c2b94d7004efad9f9e to your computer and use it in GitHub Desktop.
Selenium Vote
# -*- coding: utf-8 -*-
import sys
import selenium
from selenium import webdriver
from BeautifulSoup import BeautifulSoup
reload(sys)
sys.setdefaultencoding("utf-8")
#Abre o navegador
browser = webdriver.Firefox()
browser.set_page_load_timeout(60)
for item in xrange(3):
browser.get("https://docs.google.com/forms/d/1ruAd2Ht3KRKmX6eFBNLYZWC-HjXv313fDl4XOXo7quI/viewform?fbzx=-7495513594673560422")
check_box = browser.find_elements_by_xpath("//input[contains(@class, '%s')]" %("ss-q-checkbox") )[0]
botao_submit = browser.find_element_by_xpath("//input[contains(@id, '%s')]" %("ss-submit") )
#Escreve no input
check_box.click()
botao_submit.click()
#Fecha o navegador
browser.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment