Local API for Routine Automation Operations

  • Refresh the page

  • http://127.0.0.1:35000/api/v1/profile/refresh?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

  • The current tab to open the specified URL

  • http://127.0.0.1:35000/api/v1/profile/openurl?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&url=www.vmlogin.us

  • Get the source code of the web page

  • http://127.0.0.1:35000/api/v1/profile/source?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

  • Find the element of the web page

  • http://127.0.0.1:35000/api/v1/profile/findElement?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&function=findElementByID&args=kw&click=false&index=-1

  • function parameter support:

  • findElementByID

  • findElementByTag

  • findElementByClassName

  • findElementByLinkText

  • findElementByXPath

  • findElementsByID

  • findElementsByTag

  • findElementsByClassName

  • findElementsByLinkText

  • findElementsByXPath

  • The args parameter is the passing parameter of the function, such as: findElementByID(args).

  • When the “click” is true, after find the specified element, perform click operation. When it is false, it will not perform click operation.

  • Index means that when there are multiple elements, it will specifically click which element. Start from number 0, -1 is one of the random elements. This parameter is used when “click” is true.

  • Take the attribute value of the specified element

  • http://127.0.0.1:35000/api/v1/profile/getAttribute?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&args=[{"ELEMENT": "95365abe-6746-4703-8cfd-6316580f5289", "element-6066-11e4-a52e-4f735466cecf": "95365abe-6746-4703-8cfd-6316580f5289"}, "style"]

  • Generally, the args parameter is a JSON string that combined with Element_ID which obtained after findElement performs find element operation. For example: [{"ELEMENT": "95365abe-6746-4703-8cfd-6316580f5289", "element-6066-11e4-a52e-4f735466cecf": "95365abe-6746-4703-8cfd-6316580f5289"}, "value"]

  • The above example is take the value of the 95365abe-6746-4703-8cfd-6316580f5289 element.

  • Perform element click operation through the selector

  • http://127.0.0.1:35000/api/v1/profile/findElement?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&function=findElementByID&args=kw&click=true&index=-1

  • Send text to web page

  • http://127.0.0.1:35000/api/v1/profile/sendKeys?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&elementId=95365abe-6746-4703-8cfd-6316580f5289&value=abc

  • Generally, the elementId parameter is obtained after findElement performs find element operation. value=abc, which means send the abc string in this web page control. Please note that all the automatic actions can be performed after the web page is loaded, otherwise, the actions may be blocked.

  • Port 35000 here is the port set in my account in VMLogin client. Please pay attention to its opening and change.

  • Client restart interface

  • http://127.0.0.1:35000/api/v1/client/restart

  • Test proxy interface

  • http://127.0.0.1:35000/api/v1/proxy/test?proxytype=socks5&proxyserver=127.0.0.1&proxyport=1080&proxyusername=&proxypassword=

  • proxytype parameters: socks5/socks4/http/https

  • {"status":"ERROR", "value":"Failed to test the proxy server."}

  • {"status":"OK", "value":"country:HK\r\ncity:Central\r\nregion:HCW\r\ntz:Asia\/Hong_Kong\r\n"}