随笔分类 -  02-爬虫常用篇

<4> node.js----express服务
摘要:/* express的服务器 */ // 1. 导入express const express = require('express'); const bodyParser = require('body-parser'); // 2. js文件导入 const aesEncrypt = requi 阅读全文
posted @ 2022-11-05 22:49 不是霉蛋 阅读(27) 评论(0) 推荐(0)
<3> os.popen()获取js结果
摘要:# 访问js文件,获取结果 def decrypto(self, data: str): # 加密字符串 import os with os.popen("node js文件 {}".format(data)) as p: return p.read().strip() # js文件下(弊端:会造成 阅读全文
posted @ 2022-11-04 15:12 不是霉蛋 阅读(59) 评论(0) 推荐(0)
<2> 线程池---ThreadPoolExecutor
摘要:1 import time 2 from concurrent.futures import ThreadPoolExecutor, as_completed, ProcessPoolExecutor 3 4 5 class Spider: 6 7 executor = ThreadPoolExec 阅读全文
posted @ 2022-11-03 15:28 不是霉蛋 阅读(51) 评论(0) 推荐(0)
<1> flask服务
摘要:import flask app = flask.Flask(__name_, static_folder='static', template_folder='templates') @app.route("/") def index(): return flask.render_temp1ate 阅读全文
posted @ 2022-11-02 22:53 不是霉蛋 阅读(24) 评论(0) 推荐(0)