标签:request log efs import com ref url sage selenium
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
caps = DesiredCapabilities.CHROME
caps[‘loggingPrefs‘] = {‘performance‘: ‘ALL‘}
driver = webdriver.Chrome(desired_capabilities=caps)
driver.get("your url")
logs = [json.loads(log[‘message‘])[‘message‘][‘params‘] for log in driver.get_log(‘performance‘)]
for log in logs:
if ‘request‘ in log:
requestUrl = log[‘request‘][‘url‘]
driver.quit()
使用selenium.webdriver.common.desired_capabilities获取浏览器日志
标签:request log efs import com ref url sage selenium
原文地址:https://www.cnblogs.com/misslin/p/10234915.html