当前位置:首页 > Python教程 > python技巧

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模块,都不能实现

原文:https://www.cnblogs.com/qianjunjun/p/13403068.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐