seleniumwire貌似可以获取请求的信息--(先记录用到再看)

https://www.cnblogs.com/hhaostudy/p/16121859.html

pip install selenium-wire

 

import time
from seleniumwire import webdriver

# Create a new instance of the Chrome driver
driver = webdriver.Chrome()
# Go to the YouTube homepage.
driver.get('http://tool.liumingye.cn/music/?page=audioPage&type=migu&name=%E6%8A%96%E9%9F%B3')
time.sleep(5)
# Access requests via the `requests` attribute
for request in driver.requests:
    if request.response:
        if request.path == "/m/api/search":
            print(request.response.body.decode("utf-8"))
driver.quit()

 

posted @ 2022-09-26 18:54  凯宾斯基  阅读(171)  评论(0)    收藏  举报