Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@Brandtyy
Copy link

Brandtyy commented Jul 14, 2020

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?

Loading

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