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

相关推荐
_Jimmy_6 小时前
Agent 溯源精度提升方案
人工智能·python·langchain
q567315237 小时前
企业级 HTTP 代理采购选型:技术评估清单 15 项
开发语言·网络·爬虫·网络协议·http·隧道ip·代理ip
SamChan908 小时前
在Web应用中集成PDF多语言翻译功能:PDFTranslator API实战指南
前端·python·ai·pdf·yapi·机器翻译
天天进步20158 小时前
Python全栈项目--智能办公自动化系统
开发语言·python
颜酱8 小时前
09 | 重构项目结构
人工智能·python·langchain
kisloy9 小时前
【爬虫入门第8讲】Python爬虫反爬入门
开发语言·爬虫·python
深蓝电商API10 小时前
Selenium 已经过时了吗?
爬虫
Sisphusssss10 小时前
香橙派5plus GPIO
linux·python·ubuntu
颜酱10 小时前
08 | 把维度值同步到 Elasticsearch(生成阶段)
人工智能·python·langchain
久久学姐11 小时前
基础转码学 AI:Java+Python 双语言入门,3 个月可落地实战项目
java·python·ai·转码·实战项目