driver.find_element_by_xpath("//input[@name='username']").send_keys(username)
driver.find_element_by_xpath("//input[@name='password']").send_keys(password)
driver.find_element_by_xpath("//button[contains(.,'Log in')]").click()
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
browser = webdriver.Chrome()
browser.get('https://www.instragram.com')
wait = WebDriverWait(browser, 10)
login_elem = browser.find_element_by_xpath(
'//*[@id="react-root"]/section/main/article/div[2]/div[2]/p/a')
second_page_flag = wait.until(EC.presence_of_element_located(
(By.CLASS_NAME, "KPnG0"))) # util login page appear
user = browser.find_element_by_name("username")
passw = browser.find_element_by_name('password')
ActionChains(browser)
.move_to_element(user).click()
.send_keys('test')
.move_to_element(passw).click()
.send_keys('test')
.perform()
login_button_ = browser.find_element_by_xpath(
"//form[@class='HmktE']/div[3]/button")
login_button_.click()
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
browser = webdriver.Chrome()
browser.get('https://www.instragram.com')
login_elem = browser.find_element_by_xpath('//*[@id="react-root"]/section/main/article/div[2]/div[2]/p/a')
login_elem.click()
user = browser.find_element_by_name("username")
passw = browser.find_element_by_name('password')
ActionChains(browser)
.move_to_element(user).click()
.send_keys('test')
.move_to_element(passw).click()
.send_keys('test')
.perform()
login_button = browser.find_element_by_class_name(
'_0mzm- sqdOP L3NKy ')
login_button.click()