Created
November 22, 2018 09:36
-
-
Save manjeshpv/70a3dce8635a6b64ead69860b8ec8cfa to your computer and use it in GitHub Desktop.
scrap-workable.com.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const urls = fs.readFileSync('./resources.workable.com.csv').toString().split('\n'); | |
console.log('urls', urls) | |
const scrapeIt = require("scrape-it") | |
const out = []; | |
const loop = async( ) => { | |
for (let i=0; i<10;i++) { | |
const { data, response } = await scrapeIt(urls[i], { | |
title: "h1" | |
, responsibilities: "div.post-content.col-xs-12.col-md-9.col-md-push-3 > div.entry-content.article-content > div > ul" | |
, brief: 'div.post-content.col-xs-12.col-md-9.col-md-push-3 > div.entry-content.article-content > p:nth-child(3)' | |
, responsibilities: 'div.post-content.col-xs-12.col-md-9.col-md-push-3 > div.entry-content.article-content > ul:nth-child(7)' | |
}) | |
out.push(data) | |
} | |
fs.writeFileSync('hello.json', JSON.stringify(out)); | |
} | |
loop() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting Urls from Listing page:
Execute:
from above file u can get csv
save it a file
resources.workable.com.csv
copy this gist and execute it