Skip to content

Instantly share code, notes, and snippets.

@mottet-dev
Created Sep 4, 2018
Embed
What would you like to do?
InstagramBot
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class InstagramBot():
def __init__(self, email, password):
self.browser = webdriver.Chrome()
self.email = email
self.password = password
def signIn(self):
self.browser.get('https://www.instagram.com/accounts/login/')
emailInput = self.browser.find_elements_by_css_selector('form input')[0]
passwordInput = self.browser.find_elements_by_css_selector('form input')[1]
emailInput.send_keys(self.email)
passwordInput.send_keys(self.password)
passwordInput.send_keys(Keys.ENTER)
time.sleep(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment