只需10行代码快速实现JSRpc,最简单的JSRPC,使用Flask和selenium快速实现JsRpc
免抠代码补环境,加解密通杀方案,JSRPC远程调用浏览器
pip安装
pip install Flask
pip install selenium
代码
__author__ = 'JiuLiang'
__email__ = "jiuliange@foxmail.com"
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)