Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- import time
- class VoteBot():
- def __init__(self):
- self.driver = webdriver.Chrome("C:\webdrivers\chromedriver.exe")
- #wrong iteration
- def vote(self):
- self.driver.get ('https://trendsetters.africaupdatenewspaper.com/permanent-secretary-of-the-year/2') #you forgot the semicolon here
- #i would close the tab later with a seperate function
- if __name__ == "__main__":
- #you want to run this code only if you run this file directly
- #you need to open the class function
- votebot = VoteBot()
- votebot.vote()
- print("Voted")
- time.sleep(5)
- print("Closed")
- votebot.driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment