puppeteer 提交 gitee - win10 (放弃,改成手点)async.series

puppeteer 提交 gitee

需求

不想每次都登录到gitee上点击发布,想自动点击。
用puppeteer 模拟下
现在是win10环境,安装比较费尽
npm i puppeteer
这里用的到下载chrome包,但是这个包 就没有一个链接能下载下来的。
所以想到用本机开个服务再访问
--remote-debugging-port=9222

把chrome都关了从开,然后服务就开了
http://localhost:9222/json/version
我点运行nodejs脚本,发现chrome就甭出来了,这不是我想要的,我想要纯dos自动化的。what the

改用gitee open api

调取接口后,说是非付费用户 不给用,咱一看这 还能惯着。不用了,改手点 ok了吧~

话说为什么改手点 也不用puppeteer

一个是 我还得开个服务
另一个是 还得从新登陆,但是我已经登录了。
源码里是装headless,我又下载不下来
最后一个是,他弹完窗口,还来回蹦跶模拟操作,有那功夫我自己点一下 行吗 行吗 886

脚本解决方案

let exec = require('child_process').exec
let async = require("async")

async.series([
  next => { exec('git add .', () => next()) },
  next => { exec('git push', () => next()) },
  next => { exec('git commit -m buildFastByGiteeUpdate', () => next()) },
  next => { exec('git push -u origin master', () => next()) },
  next => {
    console.info('git is over')
    next()
  },
  next => { exec('start https://gitee.com/pengchenggang/navigator/pages', () => next()) },
])

资料

Puppeteer简单使用
https://www.cnblogs.com/cangqinglang/p/15832333.html

Puppeteer连接已有Chrome浏览器
https://cloud.tencent.com/developer/article/2041834

Gitee 极速下载 / puppeteer-nodejs
https://gitee.com/mirrors/puppeteer-nodejs

npmjs
https://www.npmjs.com/package/puppeteer

posted @ 2022-07-29 09:36  彭成刚  阅读(31)  评论(0编辑  收藏  举报