JsRpc技术服务搭建,最简单的JSRPC,Flask+undetected-chromedriver

只需10来行代码快速实现JSRpc,最简单的JSRPC

使用Flask和undetected-chromedriver快速实现JsRpc

推荐Python版本3.7.x及以上,需要pip安装

bash 复制代码
pip install Flask
pip install undetected-chromedriver
python 复制代码
__author__ = 'jiuLiang'
__email__ = "jiuliange@foxmail.com"

import undetected_chromedriver as uc
from flask import Flask, request

app = Flask(__name__)


@app.route('/execute_js', methods=['POST', 'GET'])
def execute_js():
    ex_js = request.args.get('ex_js') if request.method == "GET" else request.form.get('ex_js')
    return str(driver.execute_script(f"return {ex_js};"))


if __name__ == '__main__':
    driver = uc.Chrome()
    driver.get('https://blog.csdn.net/qq_33613696')
    app.run(host='127.0.0.1', port=8899)

其他方案实现 :

只需10行代码使用selenium快速实现jsrpc

JSRPC远程调用浏览器方法,免抠代码补环境,加解密通杀方案,基于Flask和DrissionPage

相关推荐
ZH15455891312 小时前
Flutter for OpenHarmony Python学习助手实战:API接口开发的实现
python·学习·flutter
小宋10212 小时前
Java 项目结构 vs Python 项目结构:如何快速搭一个可跑项目
java·开发语言·python
一晌小贪欢3 小时前
Python 爬虫进阶:如何利用反射机制破解常见反爬策略
开发语言·爬虫·python·python爬虫·数据爬虫·爬虫python
躺平大鹅3 小时前
5个实用Python小脚本,新手也能轻松实现(附完整代码)
python
yukai080083 小时前
【最后203篇系列】039 JWT使用
python
独好紫罗兰3 小时前
对python的再认识-基于数据结构进行-a006-元组-拓展
开发语言·数据结构·python
Dfreedom.3 小时前
图像直方图完全解析:从原理到实战应用
图像处理·python·opencv·直方图·直方图均衡化
铉铉这波能秀4 小时前
LeetCode Hot100数据结构背景知识之集合(Set)Python2026新版
数据结构·python·算法·leetcode·哈希算法
深蓝电商API4 小时前
爬虫请求频率控制与模拟人类行为
爬虫