Created
February 18, 2016 21:03
-
-
Save amar061996/575502b3659beb0a1f7d to your computer and use it in GitHub Desktop.
Login to facebook and update the desired status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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