python+selenium打開瀏覽器開發者模式


from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument("--auto-open-devtools-for-tabs") driver = webdriver.Chrome(chrome_options=options) driver.maximize_window()

只有這種方法才能打開開發者模式,在這之前嘗試用過

action = ActionChains(driver)
action.send_keys(Keys.F12).perform()

或者selenium下面的Keys模塊,都不能實現


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM