示例#1
0
ko = resp['ko']
ins = resp['ins']
rd = resp['rd']
yt = resp['yt']

cf.browser_activate(dummy_browser=False)
cf.browser.Config.implicit_wait_secs = 30

try:
    if ln:
        cf.browser_navigate_h(ln)
        cf.pause_program(2)
        cf.browser_refresh_page_h()
    cf.browser_wait_until_h(text="ClointFusion India")
    cf.pause_program(2)
    cf.browser_mouse_click_h("Like")
    cf.pause_program(3)
    cf.text_to_speech(
        f'hey {cf.user_name}, thanks, for liking our LinkedIn POST!')
except Exception as ex:
    print("Error in LinkedIn Liker" + str(ex))

try:
    if fb:
        cf.browser_navigate_h(fb)
        cf.pause_program(2)
        cf.browser_refresh_page_h()
    cf.browser_wait_until_h(text="ClointFusion India")
    cf.pause_program(2)
    cf.browser_mouse_click_h("Like")
    cf.pause_program(3)
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()
示例#3
0
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()