def login_wp(username="", password=""): #Just replace the below link with your word press user login link cf.launch_website_h("https://tech2everyone.live") # give the user name below while calling the function dont edit the below two lines cf.browser_write_h(username, "Username") cf.browser_write_h(password, "Password") cf.browser_mouse_click_h("Log In") cf.browser_mouse_click_h("Posts") lastpage = cf.browser_locate_element_h( '//*[@id="posts-filter"]/div[1]/div[3]/span[2]/a[2]') cf.browser_mouse_click_h(lastpage) select_files = cf.browser_locate_element_h('//*[@id="cb-select-all-1"]') cf.browser_mouse_click_h(select_files) bulkaction = cf.browser_locate_element_h( '//*[@id="bulk-action-selector-top"]') cf.browser_mouse_click_h(bulkaction) cf.key_press("down+down") cf.key_press("down+down") cf.key_hit_enter() Apply = cf.browser_locate_element_h('//*[@id="doaction"]') cf.browser_mouse_click_h(Apply) cf.browser_quit_h()
import ClointFusion as cf cf.browser_navigate_h("https://www.gmail.com") #user_name = cf.browser_locate_element_h("//*[@id='identifierId']") #put your email id here email = "*****@*****.**" cf.browser_write_h(email,"Email or Phone") cf.browser_mouse_click_h("Next") #password in txt file for encryption #create txt file. #add your password in it f = open("password.txt", "r") password = f.read() cf.browser_write_h(password,"Enter your password") cf.browser_mouse_click_h("Next") cf.browser_wait_until_h("loading gmail") #process for email writing starts here cf.browser_mouse_click_h("Compose") cf.browser_write_h("*****@*****.**","To") cf.browser_write_h("test" ,"Subject") cf.key_press('tab') message = "hi this is test" cf.key_write_enter(message) cf.browser_mouse_click_h("Send") cf.browser_wait_until_h("Message sent.") cf.browser_quit_h()