Skip to content

Instantly share code, notes, and snippets.

@amar061996
Created February 18, 2016 21:03
Show Gist options
  • Select an option

  • Save amar061996/575502b3659beb0a1f7d to your computer and use it in GitHub Desktop.

Select an option

Save amar061996/575502b3659beb0a1f7d to your computer and use it in GitHub Desktop.
Login to facebook and update the desired status
from selenium import webdriver
br=webdriver.Firefox()
br.get("https://www.facebook.com/login/")
def login(username,password): #Login function
email=br.find_element_by_id("email")
pw=br.find_element_by_id("pass")
email.clear()
pw.clear()
email.send_keys(username)
pw.send_keys(password)
br.find_element_by_id("loginbutton").click()
br.implicitly_wait(10)
update_status()
def update_status(): #Update status
status=raw_input("Enter the status: ")
br.find_element_by_id("u_0_12").clear()
br.find_element_by_id("u_0_12").send_keys(status)
print "updating"
br.find_element_by_id("u_0_12").submit()
uname=raw_input("Enter your Facebook Username: ")
upass=raw_input("Enter your Facebook Password: ")
login(uname,upass)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment