Skip to content

Commit

Permalink
Merge pull request #22 from swaaz/swaaz
Browse files Browse the repository at this point in the history
Swaaz
  • Loading branch information
swaaz committed Jun 7, 2020
2 parents 715899a + 9e97722 commit 9cc9e78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,7 @@ $ python3 program.py
- [Download Chrome Driver](https://chromedriver.chromium.org/downloads)
- [Setup selenium and webdriver for Linux](https://www.youtube.com/watch?v=CriSHYMtg9M)
- [Setup selenium and webdriver for Windows](https://youtu.be/FFDDN1C1MEQ)

### Contributers
- [Swaaz](https://github.com/swaaz/)
- [JBLew](https://github.com/autumnlewjb)
8 changes: 4 additions & 4 deletions program.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Instabot():
def __init__(self,username,password):
self.username = username #storing the username in class
self.password = password #storig the password in class
self.driver = webdriver.Firefox(executable_path = "./webdrivers/chrome_webdriver/chromedriver_win32/chromedriver.exe") #this is the path of webdriver, here I used geckodriver-linux since I am using Firefox in linux. Change the path of webdriver according to your environment
self.driver = webdriver.Firefox(executable_path = "./webdrivers/firefox_webdriver/geckodriver-v0.26.0-linux64/geckodriver") #this is the path of webdriver, here I used geckodriver-linux since I am using Firefox in linux. Change the path of webdriver according to your environment
self.driver.get("https://instagram.com/")
self._make_driver_wait("//input[@name=\"username\"]")
self.driver.find_element_by_xpath("//input[@name=\"username\"]").send_keys(username)
Expand All @@ -30,7 +30,7 @@ def __init__(self,username,password):
self.driver.find_element_by_xpath("//button[contains(text(), 'Not Now')]").click()
self._make_driver_wait("//button[contains(text(), 'Not Now')]")
self.driver.find_element_by_xpath("//button[contains(text(), 'Not Now')]").click()
sleep(4)
sleep(2)

#function to cancel all the pending follow requests
def cancel_sent_requests(self):
Expand Down Expand Up @@ -66,9 +66,9 @@ def cancel_sent_requests(self):
self.driver.find_element_by_xpath("//button[contains(text(), 'Requested')]").click()
self._make_driver_wait("//button[contains(text(), 'Unfollow')]")
self.driver.find_element_by_xpath("//button[contains(text(), 'Unfollow')]").click()
sleep(4)
sleep(2)
self.driver.back()
sleep(4)
sleep(3)
self.driver.refresh()
except:
print("Tadaaaa!!!!!, Task Completed!!!!")
Expand Down

0 comments on commit 9cc9e78

Please sign in to comment.