Backend Development

LOGIN YOUR IG WITH PYTHON!

Submitted by proton2w, , Thread ID: 246816

Thread Closed
12-07-2022, 06:13 PM
#1
Just donwload chromedriver and run this class.

Code:
# import webdriver
from selenium import webdriver
# create webdriver object
from time import sleep, strftime
from random import randint
import pandas as pd
from selenium.webdriver.common.by import By

chrome_driver_path = 'YOUR DONWLOAD ROOOTr' # Change this to your own chromedriver path!
webdriver = webdriver.Chrome(executable_path=chrome_driver_path)
sleep(1)

url=('https://www.instagram.com/accounts/login/?source=auth_switcher')
webdriver.get(url)
sleep(3)

button_cookie = webdriver.find_element(By.XPATH, '/html/body/div[4]/div/div/button[2]')
button_cookie.click()
sleep(2)

username = webdriver.find_element(By.NAME, 'username')
username.send_keys('YOUR USERNAME HERE')

password = webdriver.find_element(By.NAME, 'password')
password.send_keys('YOUR PASSWORD HERE')

button_login = webdriver.find_element(By.XPATH, '//*[@id="loginForm"]/div/div[3]')
button_login.click()
sleep(3)

button_notnow = webdriver.find_element(By.XPATH, '/html/body/div[1]/div/div[1]/div/div[2]/div/div/div[1]/div/div[2]/div/div/div/div/div/div/div/div[3]/button[2]')
button_notnow.click()
sleep(3)

this is how you start your new BOT on ig Coming on another post the way to start serching tags and like them all!

RE: LOGIN YOUR IG WITH PYTHON!

#2
your method it is very original to share things thank you very much

RE: LOGIN YOUR IG WITH PYTHON!

#3
Anyone got any ideas to make selectors to enahnce this that don't break as easily with ui updates because this seems to rely on a specific div order.
To start with I'd say targetting input[type="password"] would allow us to find the password field and from there we could traverse up and then down again.

Users browsing this thread: 1 Guest(s)