我需要在浏览网页时从网页中获取所有API的请求URL
有人能帮我吗?
目的是比较正在调用和应该调用的API列表
我试着用司机。get_log(“性能”)selenium方法,但我只得到了。JPG和png文件
driver.get("https:<URL>")
logs = driver.get_log("performance")
# Opens a writable JSON file and writes the logs in it
with open("network_log.json", "w", encoding="utf-8") as f:
f.write("[")
# Iterates every logs and parses it using JSON
for log in logs:
network_log = json.loads(log["message"])["message"]
f.write(json.dumps(network_log)+",")