Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- amountOfViews = raw_input("How many views do you want on your LeafiiViewBot?: \n")
- #
- # If you comment out the raw_input username and password, then you can set those variables to a fixed value, so you just need to enter the amount of views you want.
- #
- #username = raw_input("What is your username (It's an email): \n")
- username = "TheWolfBadger@gmail.com"
- #password = raw_input("What is your password: \n")
- password = "- redacted -"
- from selenium import webdriver
- from time import sleep
- viewCount = 0
- while viewCount < int(amountOfViews):
- driver = webdriver.Chrome()
- try:
- driver.get("https://leafii.com/")
- sleep(1)
- sign_in = driver.find_element_by_xpath('//*[@id="toolbar"]/md-toolbar/div/div[2]/a[2]')
- sign_in.click()
- sleep(2)
- usernameBox = driver.find_element_by_xpath('//*[@id="input_0"]')
- passwordBox = driver.find_element_by_xpath('//*[@id="input_1"]')
- signin_btn = driver.find_element_by_xpath('//*[@id="signin"]/div[2]/form/div[1]/button')
- usernameBox.send_keys(username)
- passwordBox.send_keys(password)
- signin_btn.click()
- sleep(11)
- viewBtn = driver.find_element_by_xpath('//*[@id="profile"]/div[2]/div/md-card/a[2]/button')
- viewBtn.click()
- driver.quit()
- viewCount += 1
- print "SUCCESS: We have viewed the website!"
- print "Views counted: " + str(viewCount) + "/" + str(amountOfViews)
- except:
- driver.quit()
- print "ERROR: Error has occured! Rerunning script!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement