Python - 无法通过“打开网址:xxx”始终使用相关应用程序打开此类型的链接

2024-05-19 20:11:55 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我的第一个话题和问题。我试图用Python(Pycharm)编写一个脚本,帮助我从浏览器级别通过Citrix登录到SAP。我的问题是我不能穿过弹出的窗户:

打开URL:xxx总是在关联的应用程序中打开此类链接。在

我的剧本:

*imports that I need*
driver = webdriver.Chrome('C:\User\Chromium\chromedriver.exe')
driver.maximize_window()
driver.get('https://XYZ.dk')

Detect_Reciver = driver.find_element_by_xpath('//*[@id="protocolhandler-welcome"]/div/div/div/div/a')
if Detect_Reciver == Detect_Reciver:
Detect_Reciver.click()
time.sleep(2)

问题出现在这里,加载到新页面后,弹出“openurl:xxx Always Open this type links in The associated application.”,我想按Enter或Python Escape。发送密钥(键。进入/退出)不起作用。 enter image description here 你能帮我一下吗:)?在


Tags: div脚本urldriver浏览器级别pycharmxxx