README
JSON Scraper
Tool for creating complex, multi-step static web scrapers with cookies, auth and more
Installation
JSON Scraper is built and published on the Github Package Registry.
npm install @sesamestrong/json-scraper
const {runEntireScraper}=require("@sesamestrong/json-scraper");
(async ()=>{
console.log(await runEntireScraper(require('./myScraper.json'),{username:"exampleUsername",password:"exPw"});
})();
Error Reporting
JSON Scraper adds a jsonData
and a stepNumber
property to any error that it may throw.
Use
json-scraper
is a library designed to both reduce boilerplate in web scraping and provide a secure, language-agnostic platform on which to write web scrapers.
One writes a scraper in a step-based format, such as the following:
{
"steps":[
{
"headers":{
"uri":"https://google.com/",
"method":"POST",
"headers":{
"Content-Type":"application/json"
}
},
"frame":{
"%title":"meta[property='twitter:title'] @ content",
"%imgSrc":"center img[title] @ src || https://.+