Take advantage of using full-featured Puppeteer framework wrapped into a simple POST request
Mouse clicks
Extracting data by CSS selector
Automated form submission
Keyboard input
Custom JavaScript execution
Waiting for CSS elements to appear
XHR/AJAX requests interception
... And much more!
Try BrowserCloud for Free Read the Documentationfunction scenario (page, data) {
page.goto('https://site.com/account'l);
page.type('#login', 'my-login');
page.type('#password', 'my-password');
page.click('[title="Login"]');
page.waitForSelector('.ajax-content');
const content = page.content();
return {
data: content,
type: 'application/html'
}
}
Scenario can be converted to POST request for any language:
curl --request POST 'http://chrome.browsercloud.io/scenario?token=API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{"code":"module.exports=async({page,context})=>{await page.goto(context.url,{waitUntil:\"domcontentloaded\"});await page.type(\".block.login input\",context.login);await page.type(\".block.login [type=password]\",context.password);await page.click('\''[title=\"Login securely\"]'\'');await page.waitForSelector(\".btableblock\");let payments=await page.evaluate(()=>{let result=[];let elements=document.querySelectorAll(\".balance .offscreen\");for(i=0;i<elements.length;i++){result.push(elements[i].innerText)}return result});return{data:payments,type:\"application/json\"}};","context":{"url":"https://www.bw-bank.de/en/home/login-online-banking/demo-online-banking-pushtan.html","login":"pushDEMO","password":"12345"}}'
Try Our Scenario Builder