如何在Firefox Python Selenium中打开控制台? [英] How to open console in firefox python selenium?

查看:78
本文介绍了如何在Firefox Python Selenium中打开控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Python通过Selenium打开firefox控制台.如何使用python硒打开firefox控制台?是否可以将密钥发送给驱动程序或类似的东西?

Im trying to open firefox console through Selenium with Python. How can I open firefox console with python selenium? Is it possible to send keys to the driver or something like that?

推荐答案

尝试使用 send_keys 函数模拟与常规" firefox窗口相同的过程:

Try to simulate the same procedure as a "regular" firefox window using the send_keys function:

from selenium.webdriver.common.keys import Keys
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + Keys.SHIFT + 'k')

这篇关于如何在Firefox Python Selenium中打开控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆