抓取并下载猫眼电影图片的原图
npm i maoyan-film-picture
# or
yarn add maoyan-film-picture
var MaoYanFilmPicture = require('maoyan-film-picture')
var maoyan = new MaoYanFilmPicture({
url: 'https://maoyan.com/films/1211269',
selector: '.tab-img.tab-content ul li img',
attr: 'data-src',
target: '../images'
})
maoyan.start()
猫眼电影链接
页面的选择器
选择器所选 dom 节点所需的属性
内置 bagpipe 的超时时间,默认为 400
保存的图片的路径
针对获取到的 src 的处理函数,有内置,支持用户自定义
针对 src 里提取出图片文件名的逻辑函数,有内置,支持用户自定义
MIT