Skip to content

Instantly share code, notes, and snippets.

@nithyadurai87
Created May 26, 2016 18:46
Show Gist options
  • Save nithyadurai87/c6380e75b3260a4ee5460e0fa6c8f1d3 to your computer and use it in GitHub Desktop.
Save nithyadurai87/c6380e75b3260a4ee5460e0fa6c8f1d3 to your computer and use it in GitHub Desktop.
from selenium import webdriver
a = webdriver.Firefox()
a.get("https://valaipathivu.wordpress.com/wp-admin")
a.maximize_window()
a.find_element_by_xpath("//input[@id='user_login']").send_keys("valaipathivu")
a.find_element_by_xpath("//input[@id='user_pass']").send_keys("Kadavuchol")
a.find_element_by_xpath("//input[@id='wp-submit']").click()
print "Login is successful"
a.find_element_by_link_text("Posts").click()
a.find_element_by_link_text("Add New").click()
a.find_element_by_xpath("//input[@id='title']").send_keys("Tamil Kavithaikal")
a.find_element_by_xpath("//input[@id='publish']").click()
print "New post is Published"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment