-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Create test.txt * Added Instagram Liker Bot Issue: #690 * Delete test.txt * Added Instagram Liker Bot Issue: #690 * Update README.md * Update README.md
- Loading branch information
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
Deployed Projects/Instagram_Liker_Bot/Instagram_Liker_Bot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from selenium import webdriver | ||
from webdriver_manager.chrome import ChromeDriverManager | ||
from selenium.webdriver.common.keys import Keys | ||
from getpass import getpass | ||
import time | ||
|
||
chrome = webdriver.Chrome(ChromeDriverManager().install()) | ||
chrome.get("https://www.instagram.com") | ||
time.sleep(10) | ||
|
||
username = chrome.find_element_by_xpath( | ||
'//*[@id="loginForm"]/div/div[1]/div/label/input') | ||
username.send_keys(input("Enter your username: ")) # enter username | ||
print("Enter your Password: ") | ||
password = chrome.find_element_by_xpath( | ||
'//*[@id="loginForm"]/div/div[2]/div/label/input') | ||
pswd = getpass() | ||
password.send_keys(pswd) | ||
login_button = chrome.find_element_by_xpath('//*[@id="loginForm"]/div/div[3]') | ||
login_button.click() | ||
time.sleep(10) | ||
|
||
search_bar = chrome.find_element_by_xpath( | ||
'//*[@id="react-root"]/section/nav/div[2]/div/div/div[2]/input') | ||
# enter the username to be searched | ||
search_bar.send_keys(input("Enter the username of the other person: ")) | ||
time.sleep(7) | ||
search_bar.send_keys(Keys.ENTER) | ||
search_bar.send_keys(Keys.ENTER) | ||
|
||
time.sleep(2) | ||
|
||
post = chrome.find_element_by_xpath( | ||
'//*[@id="react-root"]/section/main/div/div[3]/article/div[1]/div/div[1]/div[1]/a/div[1]/div[2]') | ||
post.click() | ||
time.sleep(2) | ||
like_button = chrome.find_element_by_xpath( | ||
'/html/body/div[5]/div[2]/div/article/div[3]/section[1]/span[1]/button') | ||
like_button.click() | ||
next_button = chrome.find_element_by_xpath( | ||
'/html/body/div[5]/div[1]/div/div/a') | ||
next_button.click() | ||
time.sleep(2) | ||
|
||
while True: | ||
try: | ||
like_button = chrome.find_element_by_xpath( | ||
'/html/body/div[5]/div[2]/div/article/div[3]/section[1]/span[1]/button') | ||
like_button.click() | ||
next_button = chrome.find_element_by_xpath( | ||
'/html/body/div[5]/div[1]/div/div/a[2]') | ||
next_button.click() | ||
time.sleep(5) | ||
except: | ||
close_button = chrome.find_element_by_xpath( | ||
'/html/body/div[5]/div[3]/button') | ||
close_button.click() | ||
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
What is the use: | ||
Given a username if the Instagram account is public or the posts are accessible to the operator, will auto-like all the posts on behalf and exit. | ||
Instructions to use: | ||
1. Once we run the program, web driver will start the default browser under automated software (here we use chrome). | ||
|
||
2. Then it will ask for the username and password for the account that will be used to give the likes. | ||
|
||
3. Then it will automatically go to the search bar, and ask for the username of the person whose post you want to like. | ||
|
||
4. After pressing enter, it will automatically open the Instagram account of the user and keep liking every available uploaded post. | ||
|
||
5. Once done, it will close the posts itself. | ||
|
||
Side note: | ||
If you are using some other web browser, replace ‘chrome’ by the name of that browser | ||
Modules and tools used: | ||
Selenium, getpass and time | ||
|
||
Development status: This is a complete version and the future version might function in adding auto-comments as well | ||
|
||
BY SUJAN GHOSH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters