I tried many times to get Performance logs but i don’t know why my code isn’t working, it always breaks at performance_logs = driver.get_log(“performance”)
from selenium import webdriver
import time
import json
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.common.exceptions import TimeoutException
options = webdriver.ChromeOptions()
options.add_argument("goog:loggingPrefs={"performance": "ALL"}")
options.add_argument("--auto-open-devtools-for-tabs")
options.add_argument("--enable-logging")
options.add_argument("--log-level=ALL")
options.add_argument("--verbose")
# options.add_argument("--headless")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options)
dev_tools = driver.execute_cdp_cmd("Performance.enable", {})
driver.get("https://gist.github.com/")
performance_logs = driver.get_log("performance")
print(driver.log_types)
time.sleep(10)
driver.quit()
:((((((((((((((((((((((((
New contributor
Nub is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.