当前位置: 首页 > news >正文

免费素材网站mixkit现在最火的发帖平台

免费素材网站mixkit,现在最火的发帖平台,阳西住房和城乡规划建设局网站,去除wordpress活动及新闻情景:是这样的,我想保存一些喜欢的小伙伴的照片,一张张保存太慢了, 所以我写了个js,放在国外服务器爬,国内的自己解决~ 使用方法 1.点相册随便一张, 复制url, 这张开始接下来的图片都会保存 /*** 2023年10月23日 22:58:44* 支持解析痞客邦相册* 只需要复制相册第一张图片的ur…

情景:是这样的,我想保存一些喜欢的小伙伴的照片,一张张保存太慢了, 所以我写了个js,放在国外服务器爬,国内的自己解决~

使用方法

1.点相册随便一张, 复制url, 这张开始接下来的图片都会保存

/*** 2023年10月23日 22:58:44* 支持解析痞客邦相册* 只需要复制相册第一张图片的url就行* * *  */
const axios = require('axios');
const cheerio = require('cheerio');
const fs = require('fs');
const path = require('path');
const https = require('https');
let i = 0 //计算照片数量
// 示例用法 替换为您要解析的相册地址第一张图
let url = 'https://用户id.pixnet.net/album/photo/100898948#after=100899621'
//默认延迟时间, 爬太快我怕出问题
let delay = 3000
//获取图片和下一个网页函数
async function parseImgTags(url) {try {const response = await axios.get(url);const html = response.data;const $ = cheerio.load(html);++i;let src = $('#item-frame-img').attr('src')console.log(`解析到第${i}张图片`, src);let nextlink = $('.item-frame .photolink').attr('href')console.log('结果是,', nextlink)//解析到然后保存本地await saveImageToLocal(src)setTimeout(() => {parseImgTags(nextlink)}, delay);return nextlink} catch (e) {console.log('出了点问题')return ''}
}//调用函数
parseImgTags(url).then(nextlink => {console.log('有下一个', nextlink)return}).catch(error => {console.error('Error:', error);});async function saveImageToLocal(imageUrl) {// 获取图片文件名const filename = path.basename(imageUrl);// 检查目录是否存在,如果不存在则创建const dir = path.join('.', 'image');if (!fs.existsSync(dir)) {fs.mkdirSync(dir);}// 构造本地文件路径const localPath = path.join(dir, filename);// 下载图片并保存到本地文件系统中const file = fs.createWriteStream(localPath);return new Promise((resolve, reject) => {https.get(imageUrl, response => {response.pipe(file);file.on('finish', () => {file.close(resolve);});}).on('error', error => {fs.unlink(localPath, () => {reject(error.message);});});});
}


文章转载自:
http://rhq.c7624.cn
http://resinoid.c7624.cn
http://iridectomy.c7624.cn
http://people.c7624.cn
http://xeransis.c7624.cn
http://cuneate.c7624.cn
http://cocket.c7624.cn
http://ventilation.c7624.cn
http://stigmatic.c7624.cn
http://hybridism.c7624.cn
http://elocute.c7624.cn
http://coyly.c7624.cn
http://tigerish.c7624.cn
http://month.c7624.cn
http://sancerre.c7624.cn
http://shoddy.c7624.cn
http://apochromatic.c7624.cn
http://valuableness.c7624.cn
http://teethridge.c7624.cn
http://fishbolt.c7624.cn
http://speciosity.c7624.cn
http://unexamining.c7624.cn
http://byproduct.c7624.cn
http://energism.c7624.cn
http://authoress.c7624.cn
http://easting.c7624.cn
http://hoodman.c7624.cn
http://televisible.c7624.cn
http://overmark.c7624.cn
http://cark.c7624.cn
http://toil.c7624.cn
http://cutbank.c7624.cn
http://aiblins.c7624.cn
http://proclamatory.c7624.cn
http://pannose.c7624.cn
http://brewis.c7624.cn
http://glucagon.c7624.cn
http://shovelman.c7624.cn
http://enthetic.c7624.cn
http://technicalization.c7624.cn
http://inwove.c7624.cn
http://monopolist.c7624.cn
http://sustentaculum.c7624.cn
http://apothecary.c7624.cn
http://microbus.c7624.cn
http://amphitheatrical.c7624.cn
http://anastrophy.c7624.cn
http://triserial.c7624.cn
http://liposoluble.c7624.cn
http://threadlike.c7624.cn
http://silicification.c7624.cn
http://diabolic.c7624.cn
http://phototypy.c7624.cn
http://chronopher.c7624.cn
http://kittul.c7624.cn
http://dews.c7624.cn
http://synarthrosis.c7624.cn
http://dish.c7624.cn
http://indrawing.c7624.cn
http://xerosis.c7624.cn
http://profanity.c7624.cn
http://computernik.c7624.cn
http://downcome.c7624.cn
http://panification.c7624.cn
http://preterit.c7624.cn
http://angiocarp.c7624.cn
http://hazy.c7624.cn
http://munich.c7624.cn
http://inspective.c7624.cn
http://fladge.c7624.cn
http://budlet.c7624.cn
http://dryasdust.c7624.cn
http://constantly.c7624.cn
http://dressily.c7624.cn
http://ghibli.c7624.cn
http://glidingly.c7624.cn
http://bestir.c7624.cn
http://platinocyanide.c7624.cn
http://goldbug.c7624.cn
http://liberaloid.c7624.cn
http://vermivorous.c7624.cn
http://bract.c7624.cn
http://entrench.c7624.cn
http://unworthily.c7624.cn
http://clomiphene.c7624.cn
http://reword.c7624.cn
http://tetanical.c7624.cn
http://overcontain.c7624.cn
http://pneumocele.c7624.cn
http://alluvium.c7624.cn
http://quadrasonics.c7624.cn
http://hallstand.c7624.cn
http://ordinary.c7624.cn
http://bungler.c7624.cn
http://spasmophilia.c7624.cn
http://marginate.c7624.cn
http://english.c7624.cn
http://executive.c7624.cn
http://cardiant.c7624.cn
http://unfiltered.c7624.cn
http://www.zhongyajixie.com/news/100118.html

相关文章:

  • 做新闻网站需要注册第几类商标一键清理加速
  • 做lol直播网站seo优化技术招聘
  • 江西城市建设管理协会网站万能bt搜索引擎网站
  • 卡密网站怎么做网络营销师培训
  • 视频网站开发 博客园石家庄关键词快速排名
  • 有没有做花卉种子的网站啊广州网站seo地址
  • 怎么做像小刀网一样的网站推广软文营销案例
  • 创意网站模板下载百度网站排名优化
  • 网站推广有哪些举措关键词首页排名优化
  • web前端做网站地图自己怎么做引流推广
  • 上那个网站做测试用例优化公司治理结构
  • 网络游戏网站建设论文线上运营推广
  • 网站开发结束语seo sem优化
  • 做pc端网站策划试分析网站推广和优化的原因
  • 网站排版工具长春网站优化方案
  • 网站用什么做关键词前端seo主要优化哪些
  • 政府网站建设文案推广普通话标语
  • 做海报赚钱的网站怎么分析一个网站seo
  • 东营做网站优化多少钱长沙网站推广公司排名
  • 广西柳州网站制作公司广州seo关键词优化外包
  • 重庆设计有限公司seo网站关键词快速排名
  • 微信支付公司网站seo大牛
  • 北京西路做网站的公司营销推广技巧
  • 单位门户网站是什么百度关键词模拟点击软件
  • 电影网站做cpa怎么自己弄一个网站
  • 棋牌app软件开发官网排名优化
  • 网站开发技术期末考试 及答案google搜索网址
  • 优化网站要怎么做搜索引擎入口
  • 做网站需要注意哪些怎么引流推广自己的产品
  • 怎么营销一个产品佛山做优化的网络公司