Geocrack

voting

Jul 2nd, 2022 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. from selenium import webdriver
  2. import time
  3. class VoteBot():
  4.  
  5.     def __init__(self):
  6.      
  7.         self.driver = webdriver.Chrome("C:\webdrivers\chromedriver.exe")
  8.      
  9.     #wrong iteration
  10.     def vote(self):
  11.  
  12.         self.driver.get ('https://trendsetters.africaupdatenewspaper.com/permanent-secretary-of-the-year/2') #you forgot the semicolon here
  13.        
  14.         #i would close the tab later with a seperate function
  15.  
  16.  
  17. if __name__ == "__main__":
  18.     #you want to run this code only if you run this file directly
  19.     #you need to open the class function
  20.     votebot = VoteBot()
  21.     votebot.vote()
  22.     print("Voted")
  23.     time.sleep(5)
  24.     print("Closed")
  25.     votebot.driver.quit()
  26.  
Advertisement
Add Comment
Please, Sign In to add comment