Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions swag.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,32 @@ def __init__(self, username, pw):
self.pw = pw
self.driver.get("https://www.swagbucks.com/p/login")
sleep(2)
self.driver.find_element_by_xpath("//input[@name=\"emailAddress\"]").send_keys(username)
self.driver.find_element_by_xpath("//input[@name=\"password\"]").send_keys(pw)
self.driver.find_element("xpath", "//input[@name=\"emailAddress\"]").send_keys(username)
self.driver.find_element("xpath", "//input[@name=\"password\"]").send_keys(pw)
sleep(2)
self.driver.find_element_by_xpath('//button[@id="loginBtn"]').click()
sleep(100) # time for you to do the thing that proves you are not a bot
self.driver.find_element("xpath", '//button[@id="loginBtn"]').click()
print( "Sleeping..." )
sleep(15) # time for you to do the thing that proves you are not a bot
print( "Done." )

def survey(self):
self.driver.find_element_by_xpath("//a[contains(@href,'/surveys')]").click()
self.driver.find_element("xpath", "/html/body/div[3]/div[1]/header/nav/div[1]/ul/li[2]/a").click()
sleep(2)
for i in range(1000):
x = random.randint(1,2)
y = random.randint(1,4)
sleep(y)
self.driver.find_element_by_class_name("surveyDropdownVal").click()
self.driver.find_element("xpath", "/html/body/div[3]/div[3]/div[1]/div[1]/div[1]/div[2]/div[2]/div[2]/div/div[2]/div/div[1]/div/span[2]").click()
sleep(x)
string1 = "/html/body/div[4]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[2]/div/div[2]/div/div[1]/div/div/span[" + str(x) + "]"
self.driver.find_element_by_xpath(string1).click()
string1 = "/html/body/div[3]/div[3]/div[1]/div[1]/div[1]/div[2]/div[2]/div[2]/div/div[2]/div/div[1]/div/div/span[" + str(x) + "]"

self.driver.find_element("xpath", string1).click()
sleep(y)
#self.driver.find_element_by_xpath('//button[@class=surveyDashboardCTA sbCta sbBgPrimaryColor"]')
self.driver.find_element_by_xpath("/html/body/div[4]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[2]/div/div[2]/div/div[2]/button").click()
#self.driver.find_element("xpath", '//button[@class=surveyDashboardCTA sbCta sbBgPrimaryColor"]')
self.driver.find_element("xpath", "/html/body/div[3]/div[3]/div[1]/div[1]/div[1]/div[2]/div[2]/div[2]/div/div[2]/div/div[2]/button").click()
#self.driver.find_elements_by_class_name("surveyDashboardCTA sbCta sbBgPrimaryColor").click()
sleep(x)
print(i)

my_bot = SwagBot(*your username*, *your password*)
my_bot = SwagBot( "Your username" , "Your password" )
my_bot.survey()