Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

auto instagram login

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep

class InstagramBot:
    def __init__(self, username, password):
        self.username = username
        self.password = password
        self.driver = webdriver.Chrome('C:Program Files (x86)chromedriver.exe')

    def CloseBrowser(self):
        self.driver.close

    def Login(self):
        driver = self.driver
        driver.get('https://instagram.com/')
        sleep(1)
        username_input = driver.find_element_by_xpath('//input[@name="username"]')
        username_input.send_keys(self.username)
        sleep(2)
        password_input = driver.find_element_by_xpath('//input[@name="password"]')
        password_input.send_keys(self.password)
        sleep(1)
        button = driver.find_element_by_xpath('//button[@type="submit"]')
        button.click()


bot1 = InstagramBot()      
bot1.Login()
        
Comment

PREVIOUS NEXT
Code Example
Python :: JET token authentication in Django UTC 
Python :: Can I convert python code to C++? 
Python :: make my own rabbit bomb using python 
Python :: get the values of your aws tags from ec2 instance 
Python :: conventional commits 
Python :: python iterate through list by chunks 
Python :: Get Dates Between Two Ranges 
Python :: axes turn of axis matplotlb 
Python :: how to make a password square multicolor square spiral python 
Python :: how to use lambda function in python 
Python :: trace table python 
Python :: convert string to double 2 decimal places python 
Python :: pandas replace duplicates unique identifier 
Python :: python how to close the turtle tab on click 
Python :: Saving a copy of rcParams settings. 
Python :: pygame is not defined 
Python :: python clean filename 
Python :: read(stdin, buf) ctf 
Python :: # find the n smallest and greatest numbers in list 
Python :: clear terminal anaconda 
Python :: xgb plot importance 
Python :: pyttsx3 listen to events 
Python :: BIDS extract JSON data 
Python :: List Comprehension simple example 
Python :: sorted string dict approach 
Python :: pandas version for python 3.9 
Python :: dict keys in tcl 
Python :: Explaining async session in requests-html 
Python :: in django drowpdown list shown in database tables 
Python :: Python NumPy asfortranarray Function Scalar to an array 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =