I found a repo I would like to use that does not include much instruction and is written in all javascript. I've installed the basic requirements, but I don't know how to proceed.
This is the main repo https://github.com/website-scraper/website-scraper-puppeteer and it uses the plugin https://github.com/puppeteer/puppeteer to add extra functionality.
How do I run the code? It is unclear in the README.
Read the instructions for puppeteer. It explains it's a node module.
So you need to install node.js from the command line.
Then using node's npm to install puppeteer.
Then add the plugin.
And finally, run puppeteer
Please acquaint yourself with "what is a node.js application" first.
https://www.tutorialspoint.com/nodejs/nodejs_introduction.htm
To download website using website-scraper-puppeteer node module you need:
website-scraper
(core module), website-scraper-puppeteer
(plugin for core module) from npmnpm install website-scraper website-scraper-puppeteer
index.js
) with some codeconst scrape = require('website-scraper');
const PuppeteerPlugin = require('website-scraper-puppeteer');
const options = {
urls: ['https://example.com'],
directory: '/path/to/save',
plugins: [
new PuppeteerPlugin()
]
};
scrape(options).then((result) => { console.log(result); });
node index.js
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.