随笔分类 -  小工具

摘要:jsdom补充document的环境 const jsdom = require("jsdom"); const {JSDOM} = jsdom; const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`, { url: 'https://w 阅读全文
posted @ 2021-11-01 17:47 阿磊小哥哥呀 阅读(1493) 评论(0) 推荐(0)
摘要:没有那么多花里胡哨: sudo npm install jsdom 阅读全文
posted @ 2021-11-01 16:57 阿磊小哥哥呀 阅读(328) 评论(0) 推荐(0)
摘要:p_list = html.xpath("//div[@class='content']/p[1]") for p in p_list: print(p.xpath('string(.)').strip()) 阅读全文
posted @ 2020-12-18 11:57 阿磊小哥哥呀 阅读(1133) 评论(0) 推荐(1)
摘要:Python实现定时器,任意时间、方式执行 pip install apscheduler from apscheduler.schedulers.blocking import BlockingScheduler from datetime import datetime # 输出时间 def j 阅读全文
posted @ 2020-09-19 13:51 阿磊小哥哥呀 阅读(171) 评论(0) 推荐(0)
摘要:from PIL import Image import os def get_size(file): # 获取文件大小:KB size = os.path.getsize(file) return size / 1024 def get_outfile(infile, outfile): if o 阅读全文
posted @ 2020-08-21 20:15 阿磊小哥哥呀 阅读(787) 评论(0) 推荐(0)
摘要:AliLogin(sys.argv[1], sys.argv[2], sys.argv[3]) # 一共三个参数 启动方式 python main.py params1 params2 params3 阅读全文
posted @ 2020-08-21 10:31 阿磊小哥哥呀 阅读(445) 评论(0) 推荐(0)
摘要:# python安装reportlab pip install reportlab -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com参考https://blog.csdn.net/zhezhebie/article/de 阅读全文
posted @ 2020-07-25 09:54 阿磊小哥哥呀 阅读(323) 评论(0) 推荐(0)
摘要:reres可以在谷歌应用商店安装,也可以去百度找下载地址 后面也有处理reres使用本地文件无效的问题 安装好后这里有两个参数 第一个是正则匹配你要替换的js路径文件 第二个是本地文件,也可以使用路径文件地址替换 路径文件:http://localhost:8001/demo.js 本地文件:可以参 阅读全文
posted @ 2020-07-15 21:29 阿磊小哥哥呀 阅读(2085) 评论(0) 推荐(0)
摘要:import base64 str1 = "你好" b = base64.b64encode(str1.encode('utf-8')).decode("utf-8") print(b) print(type(b)) c = base64.b64decode(b.encode("utf-8")).d 阅读全文
posted @ 2020-07-14 12:06 阿磊小哥哥呀 阅读(241) 评论(0) 推荐(0)
摘要:处理证书只需要一串代码 response = requests.get(url,verify=False) 阅读全文
posted @ 2020-07-14 12:04 阿磊小哥哥呀 阅读(860) 评论(0) 推荐(0)
摘要:import datetime import os from flask import Flask, send_from_directory, request from flask_cors import CORS app = Flask(__name__) CORS(app) @app.route 阅读全文
posted @ 2020-07-04 14:06 阿磊小哥哥呀 阅读(958) 评论(0) 推荐(0)
摘要:centos安装lrzsz使用rz和sz完成文件传输 # yum -y install lrzsz // 上传文件,执行命令rz,会跳出文件选择窗口,选择好文件,点击确认即可。 # rz // 下载文件,执行命令sz # sz 阅读全文
posted @ 2020-06-28 16:33 阿磊小哥哥呀 阅读(331) 评论(0) 推荐(0)
摘要:import osimport statos.chmod(basedir, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) 阅读全文
posted @ 2020-06-16 10:53 阿磊小哥哥呀 阅读(1092) 评论(0) 推荐(0)
摘要:Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWar 阅读全文
posted @ 2020-04-23 09:52 阿磊小哥哥呀 阅读(922) 评论(0) 推荐(0)
摘要:import logging from logging import handlers class Logger(object): level_relations = { 'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging 阅读全文
posted @ 2020-04-22 16:40 阿磊小哥哥呀 阅读(1548) 评论(0) 推荐(0)
摘要:#打包 pip freeze >requirements.txt # 安装 pip install -r requirements.txt 阅读全文
posted @ 2020-04-16 13:29 阿磊小哥哥呀 阅读(630) 评论(0) 推荐(0)