odax / web-scrape-x

simple cli webscraper built on node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web Scrape X

cli web scraper
default url: naleeriddell.com
default query: console.log($('li').text());

Instructions:
with node installed, navigate to repo and type npm install
to start: node scrape.js
first prompt is url, type in the webpage url you want to scrape
second prompt is query, type in the callback function for the returned data

For Callback Function
query syntax is jquery, for more info visit cheerio.js.org
$ === the returned promise from fetching data

example
on query prompt:
$('h1').each((i, el) => { const item = $(el).text(); console.log(item); })

to scrape and console.log h1's

About

simple cli webscraper built on node


Languages

Language:JavaScript 100.0%