Puppeteer--API解析

一、获取元素信息 page.$(selector) 在页面内执行document.querySelector。 page.$$(selector) 在页面内执行document.querySelectorAll。 page.$x(expression) 解析指定的XPath表达式。 page.$$eval(selector, pageFunction[, ...args]) 在页面内执行Array.from(document.querySelectorAll(selector)),然后把匹配到的元素
分类至 JS
0条评论

nginx的ip hash 解决 pm2(cluster)集群解决方案

公司项目需要将同一个链接的请求打到同一台机器上;就是pm2(cluster)集群解决方案中从某个进程发起的请求将来要能回到这个进程中运用,第一个想到的当然是nginx的ip_hash了,这算是成本最低的方案了。 upstream io_nodes { ip_hash; server 127.0.0.1:3131; server 127.0.0.1:3132; server 127.0.0.1:3133; server 127.0.0.1:3134
分类至 JS
0条评论

Nodejs定时任务(node-schedule)

Nodejs定时任务(node-schedule) 安装 npm install node-schedule --save 或者 yarn add node-schedule 用法 const schedule = require('node-schedule'); const scheduleCronstyle = ()={ //每分钟的第30秒定时执行一次: schedule.scheduleJob('30 * * * * *',()={ console.
分类至 JS
0条评论

node 针对服务器pm2进程管理器好用的日志分割工具-pm2-logrotate

pm2-logrotate是一个npm管理模块 1.安装命令 pm2 install pm2-logrotate, 如果在服务上安装特别慢的话,需要配置淘宝源 npm config set registry https://registry.npm.taobao.org/ 2.查看pm2-logrotate默认的参数 pm2 conf pm2-logrotate 3.设置参数命令 pm2 set pm2-logrotate:max_size 1K 命令设置具体的参数,支持的参数有以下: l Compre
分类至 JS
0条评论

js中运行字符串中的表达式

前言 最近在项目开发中,有了这么个需求,数据返回的是字符串类型的表达式,需要根据该表达式生成对应的分数。我的项目是vue2+ts,所有一开始我直接在模板中写道: tempalte // 用的是elemntUI的table组件,反正下面的scope.row.formula能拿到需要的字符串 div{{ scope.row.formula }}/div /template 可是很快就出现问题了,它并不会运行这个字符串,而是直接返回了它,所以我们就需要能够运行字符串的方法了,开百。 eval 首先,eval
分类至 JS
0条评论

mac破解zip压缩文件密码

亲测有用,特地备份。 fcrackzip简介 fcrackzip是一款专门破解zip类型压缩文件密码的工具,工具小巧方便、破解速度快,能使用字典和指定字符集破解,适用于linux、mac osx 系统 fcrackzip安装 brew install fcrackzip fcrackzip参数介绍 终端输入命令: fcrackzip -h 显示结果: fcrackzip version 1.0, a fast/free zip password cracker written by Marc Lehm
分类至 其他
0条评论