Answer the question
In order to leave comments, you need to log in
How to write a script to parse images from html pages locally?
Please tell me how to implement the following:
There are a lot of html pages (downloaded on a PC). These pages contain catalogs of photos. Manually downloading each image separately is not the best option. I would like to upload all photos from html pages to a separate folder. How can I do that? I think I'll try to figure it out myself and write a similar script, if it's real, of course, to do it (upload a photo from an html file).
PS. The language is essentially not important, but preferably php, js / node.
Answer the question
In order to leave comments, you need to log in
upload all photos from html pages -- are they there just like img src="" ?
cheerio.js for a node, you
load html into it, and you get arrays from it through regular css selectors
https://hackernoon.com/cheerio-node-nodejs-tutoria...
https://github.com/cheeriojs/cheerio
i.e. pseudocode
fs.readFile('myHtml.html') -> cheerio.load(file) -> imageArray = $(' .klassFotok img ') -> imageArray.forEach fetch img src and save
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question