Skip to content

Instantly share code, notes, and snippets.

@VirenMohindra
Created November 27, 2018 15:41
Show Gist options
  • Save VirenMohindra/77b6b51b10ebe0ca207a7f0752ef7266 to your computer and use it in GitHub Desktop.
Save VirenMohindra/77b6b51b10ebe0ca207a7f0752ef7266 to your computer and use it in GitHub Desktop.
Auto votes in surveys on survey monkey.
"""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
@bschwar9
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment