Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Log into facebook with selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
driver.get("Https://facebook.com")
def userInfo(Username,Password):
user = driver.find_element_by_xpath("//*[@id='email']")
user.send_keys(Username)
password = driver.find_element_by_xpath("//*[@id='pass']")
password.send_keys(Password)
login = driver.find_element_by_id("loginbutton")
login.click()
userInfo("email","password")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.