如何使用Selenium Python从网络获取预请求响应

时间:2020-04-08 13:01:47

标签: python selenium google-chrome selenium-webdriver google-chrome-devtools

我想通过selenium从chrome网络中的请求中获取响应。我已使用此代码提取了请求网址和网络请求标头

    capabilities['goog:loggingPrefs'] = {'performance': 'ALL'}
    driver = webdriver.Chrome(
    executable_path=os.path.abspath(str(dir_path) + "/chromedriver"),
    chrome_options=chrome_options,desired_capabilities=capabilities)
    driver.get("url")
    for entry in driver.get_log('performance'):
        print(entry)

但是无法获得这些请求的响应。有什么方法可以获取这些网络预请求的响应。

0 个答案:

没有答案