Advertisement
ssdnet

Untitled

Mar 8th, 2024
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.34 KB | None | 0 0
  1. def CreateAccount(rooturl,username,password,email,headless=False)->str:
  2.     Init("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",headless)
  3.  
  4.     ret = GetPage(rooturl)
  5.     if ret != 200:
  6.         DeInit()
  7.         return("ERROR: "+str(ret))
  8.     ret = ClickElement_ByXPATH('//*[@id="top"]/div[1]/nav/div/div[3]/div[1]/a[2]/span',5,2)
  9.     if ret != "OK":
  10.         DeInit()
  11.         return(ret)
  12.  
  13.     ret = GetElementListWhenIDContains("_xfUid-")
  14.     if ret != "OK":
  15.         DeInit()
  16.         return(ret)
  17.     time.sleep(1)
  18.  
  19.     ret = SetInElementList('autocomplete','username',username)
  20.     if ret != "OK":
  21.         DeInit()
  22.         return(ret)
  23.     time.sleep(1)
  24.  
  25.     ret = SetInElementList('autocomplete','new-password',password)
  26.     if ret != "OK":
  27.         DeInit()
  28.         return(ret)
  29.     time.sleep(1)
  30.  
  31.     ret = SetInElementList('autocomplete','email',email)
  32.     if ret != "OK":
  33.         DeInit()
  34.         return(ret)
  35.     time.sleep(1)
  36.  
  37.     ret = ClickElement_ByCSSSelector("dd > .iconic > i",5,1)
  38.     if ret != "OK":
  39.         DeInit()
  40.         return(ret)
  41.  
  42.     ret = ProcessreCaptchaV2(3)
  43.  
  44.     ret = WaitUntilElementInvisible_ByCSSSelector('#js-regTimer > span',10)
  45.     if ret != "OK":
  46.         DeInit()
  47.         return("ERRPR: ELEMENT NOT FOUND")
  48.  
  49.     ret = ClickElement_ByCSSSelector("#js-signUpButton",5,1)
  50.     if ret != "OK":
  51.         DeInit()
  52.         return("ERROR: SUBMIT BUTTON NOT FOUND")        
  53.  
  54.     ret = FindInSource("thanks for registering. in order to complete your registration, you must follow the link in the email that has been sent to you")
  55.     if ret == "OK":
  56.         DeInit()
  57.         return("SUCCESS: ACCOUNT CREATE NEED EMAIL ACTIVATION")
  58.  
  59.     ret = FindInSource("thanks for registering. your registration is now complete.")
  60.     if ret == "OK":
  61.         DeInit()
  62.         return("SUCCESS: ACCOUNT CREATE AND ACTIVATED")
  63.  
  64.     SwitchToWindow(2)
  65.     ret = FindInSource("the specified user name is already in use")
  66.     if ret == "OK":
  67.         SwitchToDefault()
  68.         DeInit()
  69.         return("FAILED: USERNAME IN USE")
  70.  
  71.     ret = FindInSource("the specified email address is already in use")
  72.     if ret == "OK":
  73.         SwitchToDefault()
  74.         DeInit()
  75.         return("FAILED: EMAIL IN USE")
  76.  
  77.     SwitchToDefault()
  78.     DeInit()
  79.     return("OK")
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement