Scripting in RESTful API's

Anyone figure out how to login and access deeper pages using the RESTful API? I understand you can do scripting, but I am a bit confused on how to incorporate it into my project.

Currently I am using Python-Selenium to start the RESTful API and appending all the parameters. I am familiar with steps in Selenium to crawl through the website, but using a one string action, I do not get how this would be performed. Basically I have a login button, that takes you to a new URL with a redirect back, making this step more complicated.

Any ideas would be a big help!

Sorry, I have no idea how you’d use Python-Selenium with the REST API but scripts should be easy enough. First, get it working on manually submitted tests to make sure the script does what you want and then when you have a working script you just pass that to the REST API as the “script” parameter. If you are making GET requests to the API just make sure to urlencode the script and it should just work.

Hi, I am using Selenium (Python API) in two instances, one script, so I can process info needed from the tested website (i.e. get recent cookies). Then I use PhantomJS webdriver (within Selenium) to launch the REST API with a json returned data. From that point, I can continue the script to download csv or xml.

As for passing in the “script” I believe I got it last night, but if I have issues it will likely be urlencode that you recommended. Once I get it working I will update my progress, thanks for the response.

Hi Patrick,

I was able to get everything working after using your built in “script” DOM navigation, rather than passing cookies. And I am now working out a way to write readable “script”, then process into url-encoded as suggested. Thanks for all the work you are doing here, awesome tool and community!