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

只需10行代码快速实现JSRpc,最简单的JSRPC,使用Flask和selenium快速实现JsRpc

免抠代码补环境,加解密通杀方案,JSRPC远程调用浏览器

pip安装

pip install Flask 
pip install selenium

代码

__author__ = 'JiuLiang'
__email__ = "[email protected]"

from flask import Flask, request
from selenium import webdriver

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};"))

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

其他方案 实现:

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

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

你可能感兴趣的:(Python,Python-爬虫,python,开发语言,JSRPC,爬虫,自动化)