we can use selenium to automate our facebook login:
from selenium import webdriver
PATH = "C:\Program Files\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.facebook.com/")
print(driver.title)
driver.find_element_by_id('email').send_keys('zhuby1973@gmail.com')
driver.find_element_by_id('pass').send_keys('password')
driver.find_element_by_id('loginbutton').click()
C:\Users\zhuby\hans>fb_login.py
DevTools listening on ws://127.0.0.1:50006/devtools/browser/c11f32df-6a6e-4d33-8f91-bf4173548ae5
Facebook – Log In or Sign Up