from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://facebook.com")
email = "email"
password = "pass"
login="loginbutton"
emailelement = driver.find_element_by_name(email)
passwordelement = driver.find_element_by_name(password)
emailelement.send_keys("##username###")
passwordelement.send_keys("##password###")
loginelement = driver.find_element_by_id(login)
loginelement.click()
drop="userNavigationLabel"
dropelement = driver.find_element_by_id(drop)
dropelement.click()
logout="uiLinkButtonInput"
logoutelement = driver.find_element_by_class_name(logout)
logoutelement.click()
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeletelogout is not working can u plz confirm it.
ReplyDeleteWhat error you are getting?
Deleteok i solved it in different method.
DeleteThis comment has been removed by a blog administrator.
Delete