Quick Scraper NodeJS SDK
Register For Free https://www.quickscraper.co
It does supports EcmaScript 8, TypeScript, async-await, Promises !
It does also supports for AWS Lambda like serverless cloud function call.
Please Feel free to create Issue for any help !
Installation
npm install quickscraper-sdk@latest --save
Get Free Account (No Credit Card Required)
Examples
Typescript
import { QuickScraper } from "quickscraper-sdk";
const QuickScraperClient = new QuickScraper();
try {
const ACCESS_TOKEN = "";
QuickScraperClient.setAccessToken(ACCESS_TOKEN);
const requestUrl = "http://httpbin.org/ip";
const response = await QuickScraperClient.getHtml(requestUrl);
console.log("htmlResponse ", response.data);
console.log("metadata ", response.metadata);
} catch (error) {
console.log("error ", error);
}
Javascript
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
try {
const ACCESS_TOKEN = "";
QuickScraperClient.setAccessToken(ACCESS_TOKEN);
const requestUrl = "http://httpbin.org/ip";
const response = await QuickScraperClient.getHtml(requestUrl);
console.log("htmlResponse ", response.data);
console.log("metadata ", response.metadata);
} catch (error) {
console.log("error ", error);
}
Basic Usage
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("http://httpbin.org/ip");
Write a HTML to File
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
await QuickScraperClient.writeHtmlToFile("http://httpbin.org/ip", 'filename.html');
Rendering Javascript
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("http://httpbin.org/ip", {
render: true,
});
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("https://httpbin.org/headers", {
isKeepHeaders: true,
customRequestHeaders: {
"X-My-Custom-Header": "QS-APP",
},
});
Geographic Location
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("http://httpbin.org/ip", {
country_code: "US",
});
console.log(response);
Premium Residential/Mobile Proxy Pools
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("http://httpbin.org/ip", {
premium: true,
});
console.log(response);
Account Information
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const usage = await QuickScraperClient.account();
console.log(usage);
Device Type
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("http://httpbin.org/ip", {
device_type: 'mobile'
});
console.log(response);
Parser Addon
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("http://httpbin.org/ip", {
parserSubscriptionId: 'YOUR_PARSER_SUBSCRIPTION_ID'
});
console.log(response);
Webhook Addon
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("http://httpbin.org/ip", {
webhookRequestId: 'WEBHOOK_REQUEST_ID'
});
console.log(response);
Get JSON from data
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getData("http://httpbin.org/ip", {
parserSubscriptionId: 'YOUR_PARSER_SUBSCRIPTION_ID'
});
console.log(response);
Submit form data
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getData("http://httpbin.org/ip", {
formData: {
formSelector: 'FORM_SELECTOR',
submitButtonSelector: 'SUBMIT_BUTTON_SELECTOR',
formSelectorScript: 'FORM_SELECTOR_SCRIPT',
submitButtonSelectorScript: 'SUBMIT_BUTTON_SELECTOR_SCRIPT',
formFields: [
{
value: 'VALUE_TO_PASS_IN_FORM',
selectorScript: 'SELECT_INPUT',
isScript: 'BOOLEAN'
}
]
},
isKeepFormDataSelection: true,
});
console.log(response);
Add dynamic inputs
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getData("http://httpbin.org/ip", {
parserSubscriptionId: 'YOUR_PARSER_SUBSCRIPTION_ID',
dynamicInputs: [
{
"name":"YOUR_INPUT_NAME",
"value":"YOUR_VALUE"
}
]
});
console.log(response);
Actions
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("https://www.hilton.com/en/locations/india/?WT.mc_id=zLADA0IN1MB2PSH3GGL4INTCRB5dkt6MULTIBR7en_&epid!_&ebuy!&&&&&gad_source=1&gclid=CjwKCAiAvJarBhA1EiwAGgZl0HWfZEaLc_HWhRFRxTT3gs8pwQvFZKtLPNMj3szkjCbFzlef4ox_XxoCGDYQAvD_BwE&gclsrc=aw.ds", {
customSelectors: [{
"name": "YOUR_VALUE",
'selectorScript': "YOUR_SELECTOR",
'options': null,
'isScript': false
}],
keepSelection: true
});
console.log(response);
Scroll To Bottom Of The Page
const QuickScraper = require("quickscraper-sdk");
const QuickScraperClient = new QuickScraper();
QuickScraperClient.setAccessToken("YOUR_ACCESS_TOKEN");
const response = await QuickScraperClient.getHtml("YOUR_REQUEST_URL", {
isScroll: true,
scrollTimeout: 1000
});
console.log(response);
Do you need an expert?
Are you finding a developer for your world-class product? If yes, please contact here.
Originally by QuickScraper Developers - app@quickscraper.co.