简体   繁体   English

如何使用 Selenium 从 Firefox 删除消息浏览器处于远程控制之下

[英]How to remove the message Browser is under remote control from Firefox using Selenium

I want to remove this machine icon while running firefox using selenium using python3我想在运行 firefox 使用 selenium 使用 python3 时删除这个机器图标

火狐消息

Here is my code:-这是我的代码:-

from selenium import webdriver
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
profile = webdriver.FirefoxProfile('C:\\Users\\you\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\64nrwj2y.default-release')
PROXY_HOST = "87.255.27.163"
PROXY_PORT = "3128"
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'
profile.set_preference("general.useragent.override", user_agent)
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.http", PROXY_HOST)
profile.set_preference("network.proxy.http_port", int(PROXY_PORT))
profile.set_preference("dom.webdriver.enabled", False)
profile.set_preference('useAutomationExtension', False)
options=webdriver.firefox.options.Options()
profile.update_preferences()
desired = webdriver.DesiredCapabilities.FIREFOX
binary = FirefoxBinary('D:\\Mozilla Firefoxy\\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary, firefox_profile=profile, executable_path=GeckoDriverManager().install(), desired_capabilities=desired)
driver.get('https://stackoverflow.com')

But it keeps showing like this.但它一直这样显示。

As per the Abstract section of WebDriver W3C Specification WebDriver is a remote control interface that enables introspection and control of user agents.根据WebDriver W3C 规范Abstract部分, WebDriver是一个远程控制接口,可以对用户代理进行自省和控制。 It provides a platform independent and language neutral wire protocol as a way for out-of-process programs to remotely instruct the behavior of web browsers.它提供了一个独立于平台的语言中性线协议,作为进程外程序远程指示 web 浏览器行为的一种方式。

WebDriver provides us a set of interfaces to discover and manipulate DOM elements in web documents and to control the behavior of a user agent. WebDriver 为我们提供了一组接口来发现和操作 web 文档中的 DOM 元素并控制用户代理的行为。 It is primarily intended to allow to write tests that automate a user agent from a separate controlling process and also be used in such a way as to allow in-browser scripts to control a separate browser.它的主要目的是允许编写测试,使用户代理从单独的控制过程中自动化,并且还可以以允许浏览器内脚本控制单独的浏览器的方式使用。

Further, in the Security section of the specification also mentions that it was suggested that user agents make an effort to visually distinguish a user agent session that is under control of WebDriver from those used for normal browsing sessions.此外,在规范的安全部分还提到,建议用户代理努力在视觉上区分受 WebDriver 控制的用户代理 session 与用于正常浏览会话的用户代理。 This can be done through a browser chrome element such as a door hanger , colorful decoration of the OS window, or some widget element that is prevalent in the window so that it easy to identify automation windows.这可以通过浏览器 chrome 元素来完成,例如门衣架、操作系统 window 的彩色装饰,或 window 中流行的一些小部件元素,以便轻松识别自动化 Z0F4137ED1502B5045D6083AA258B。

This feature is implemented in through the Robot icon along with the tool tip which reads "Browser is under remote control"此功能在中通过机器人图标以及"Browser is under remote control"工具提示实现

浏览器被远程控制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM