关闭远程调试以在 Internet Explorer 模式下打开此站点。否则,它可能无法按预期工作
我试图在边缘浏览器上使用 selenium python 自动化一些工作流程,但我陷入了奇怪的场景。
当我运行selenium脚本时,网页的布局显示像chrome浏览器中的布局(不兼容,菜单栏选项垂直显示),并且一旦单击提交,“提交”按钮就会变灰按钮。但是,当我在 Edge 浏览器中手动执行相同的操作时,它工作正常(菜单栏选项水平显示)。
当我运行 selenium 脚本时,我注意到 Edge 浏览器上显示一个信息栏, “关闭远程调试以在 Internet Explorer 模式下打开此站点。否则,它可能无法按预期工作。” 是否是远程调试模式导致了该问题?如果是这样我该如何将其关闭?我已经在 StackOverflow 上尝试过多个帖子,但没有找到解决方案。如果需要任何其他信息,请告诉我。
from selenium import webdriver
from selenium.webdriver.edge.service import Service
edge_options = webdriver.EdgeOptions()
edge_options.add_argument("user-data-dir=C:\\Users\\XYZ\\AppData\\Local\\Microsoft\\Edge\\User Data1")
ser = Service("C:/Users/XYZ/ABC/msedgedriver.exe")
edge_browser = webdriver.Edge(options = edge_options, service=ser)
edge_browser.maximize_window()
edge_browser.get("***Site URL***")
注意:该应用程序与 chrome、firefox 等不兼容,仅适用于 Edge 和 IE 浏览器,并且 IE 最近已停用。
我相信这个问题仅适用于我正在使用的网站,因为我已经对其他网站进行了测试,它们工作正常。我可以看到信息栏“关闭远程调试以在 Internet Explorer 模式下打开此站点。否则,它可能无法按预期工作”仅适用于特定站点
I am trying to automate some workflow using selenium python on edge browser, I am stuck with the weird scenario.
When I run the selenium script, the Layout of the webpage displays like the Layout in the chrome browser(which is not compatible, Menu bar options shows Vertically) and also "Submit" button gets greyed out as soon as click on submit button. However, When I perform the same operation manually in the edge browser, it works fine (Menu bar options shows horizontally).
When I run the selenium script, I have noticed that an info bar is showing on the Edge browser that "Turn off remote debugging to open this site in internet explorer mode. Otherwise, it might not work as expected." Is remote debugging mode causing the issue? If so how would I turn it off? I have tried multiple posts in StackOverflow on this but did not find the solution. Please let me know if any other information is needed.
from selenium import webdriver
from selenium.webdriver.edge.service import Service
edge_options = webdriver.EdgeOptions()
edge_options.add_argument("user-data-dir=C:\\Users\\XYZ\\AppData\\Local\\Microsoft\\Edge\\User Data1")
ser = Service("C:/Users/XYZ/ABC/msedgedriver.exe")
edge_browser = webdriver.Edge(options = edge_options, service=ser)
edge_browser.maximize_window()
edge_browser.get("***Site URL***")
Note: Application is not compatible with chrome, firefox and etc. And works only on the edge and IE browsers and IE got decommissioned recently.
I believe the issue is only for the site which I am using as I have tested with other sites, they are working properly. And I could see info bar "Turn off remote debugging to open this site in internet explorer mode. Otherwise, it might not work as expected" for specific site only
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论