Automatic FB login
September 25, 2022
# By pillalamarri.in
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
user_id=input('Enter User Id of your Fb Account :') # Take user id and password as input from the user
password=input('Enter the password :')
print(user_id)
print(password)
cd='C:\\webdrivers\\chromedriver.exe' #path to your chrome driver
browser= webdriver.Chrome(cd)
browser.get('https://www.facebook.com/')
user_box = browser.find_element_by_id("email") # For detecting the user id box
user_box.send_keys(user_id) # Enter the user id in the box
password_box = browser.find_element_by_id("pass") # For detecting the password box
password_box.send_keys(password) # For detecting the password in the box
login_box = browser.find_element_by_id("u_0_b") # For detecting the Login button
login_box.click()
# By pillalamarri.in
Posted in Python