Created
November 27, 2018 15:41
-
-
Save VirenMohindra/77b6b51b10ebe0ca207a7f0752ef7266 to your computer and use it in GitHub Desktop.
Auto votes in surveys on survey monkey.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Requires Selenium""" | |
from selenium import webdriver | |
CHROME_OPTIONS = webdriver.ChromeOptions() | |
CHROME_OPTIONS.add_argument("--incognito") | |
CHROME_OPTIONS.add_argument("--headless") | |
COUNT = 0 | |
MAX_VOTES = 150 | |
# Change value in ADD_LINK_HERE (whatever your survey link is) | |
# Change value in TEXT_YOU_WANT_TO_TARGET for forms with radio button inputs. | |
while COUNT < MAX_VOTES: | |
DRIVER = webdriver.Chrome(chrome_options=CHROME_OPTIONS) | |
DRIVER.get('https://www.surveymonkey.com/r/ADD_LINK_HERE') | |
# 1st page | |
ELEM = DRIVER.find_element_by_class_name("next-button") | |
ELEM.click() | |
# 2nd page | |
ELEM = DRIVER.find_element_by_xpath("//label/span[contains(text(), 'TEXT_YOU_WANT_TO_TARGET')]/ancestor::label") | |
ELEM.click() | |
ELEM = DRIVER.find_element_by_class_name("next-button") | |
ELEM.click() | |
# 3rd page | |
ELEM = DRIVER.find_element_by_xpath("//label/span[contains(text(), 'TEXT_YOU_WANT_TO_TARGET')]/ancestor::label") | |
ELEM.click() | |
ELEM = DRIVER.find_element_by_class_name("done-button") | |
ELEM.click() | |
COUNT += 1 | |
print 'completed ' + str(COUNT) + ' surveys' | |
DRIVER.close() | |
print COUNT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get a lot of errors and this doesn't seem to work. I've tried messing around with it some but I am still very new to programming. Is this outdated now or should it still work?