jonstuebe / scraper Goto Github PK
View Code? Open in Web Editor NEWNode.js based scraper using headless chrome
License: MIT License
Node.js based scraper using headless chrome
License: MIT License
I've got a custom scraper that pulls more Amazon data, inside an async.eachLimit loop.
asynclib.eachLimit(asins, 1, function(asin, callback) {
// do stuff here
startScrape(asin, function(cb){
callback();
})
}, function(e){
console.log('All Done')
});
async function startScrape(asin, callback) {
const site = {
name: "amazon",
hosts: ["www.amazon.com", "smile.amazon.com"],
scrape: async page => {
const title = await getText("#productTitle", page);
const brand = await getText("#bylineInfo_feature_div", page);
const bullets = await getText("#feature-bullets ul", page);
const price = await getText("#priceblock_ourprice", page);
const description = await getText("#productDescription", page);
const type = await getText("body", page);
return {
title,
brand,
bullets,
price,
description,
type
};
}
};
try {
console.log('Fetching ' + asin)
const data = await Scraper.scrape(`http://www.amazon.com/gp/product/${asin}/`,site);
// do stuff with data
callback()
} catch(e) {
callback()
}
}
What I've found though, is after going through a list of thousands of ASINs, it eventually brings my PC to a halt. Looking inside Task Manager, it seems that a new instance of Chromium is created for every scrape, but they never get closed, hence eating ram.
Hi,
First of all this is great work.
I want to know how can I get multiple images in Slider.
Sample output reads:
{ title: 'Amazon Echo - Black (1st Generation)',
price: '',
image: 'https://images-na.ssl-images-amazon.com/images/I/61GlYAX7WoL._SY355_.jpg',
description: 'Plays all your music from Amazon Music, Spotify, Pandora, iHeartRadio, TuneIn, and more using just your voice\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\tCall or message anyone hands-free with your Echo device. Also, instantly connect to other Echo devices in your home using just your voice.\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\tFills the room with immersive, 360º omni-directional audio. Play music simultaneously across Echo devices with multi-room music (Spotify and Sirius XM support coming soon).\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\tHears you from across the room with far-field voice recognition, even while music is playing\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\tAnswers questions, reads the news, reports traffic and weather, reads audiobooks from Audible, gives info on local businesses, provides sports scores and schedules, controls Amazon Video on Fire TV, and more using the Alexa Voice Service\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\tControls lights, fans, TVs, switches, thermostats, garage doors, sprinklers, locks, and more with compatible connected devices from WeMo, Philips Hue, Sony, Samsung SmartThings, Nest, and others\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\tAlways getting smarter and adding new features, plus thousands of skills like Uber, Domino\'s, DISH, and more' }
Price data is blank. Needs to be updated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.