只需10来行代码快速实现JSRpc,最简单的JSRPC
使用Flask和undetected-chromedriver快速实现JsRpc
推荐Python版本3.7.x及以上,需要pip安装
pip install Flask
pip install undetected-chromedriver
__author__ = 'jiuLiang'
__email__ = "[email protected]"
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