簡體   English   中英

我想通過pywin32更改Internet Explorer的設置

[英]I want to change setting of internet explorer through pywin32

我想通過pywin32更改資源管理器的設置,我能夠在瀏覽器中獲取url和數據,但無法訪問工具和其他設置選項。

那是有趣的任務。 我只是不知道如何在IE中創建子菜單窗口。 以下代碼按“工具”菜單按鈕(IE 8),但無法檢測到菜單窗口。 解決方法是鍵入密鑰。

import pywinauto, time

app = pywinauto.Application().start_(r"C:\Program Files (x86)\Internet Explorer\iexplore.exe")
main = app.Window_(title_re='^.* - Windows Internet Explorer$')

main.PageControlToolbar.PressButton(6) # stop loading, just in case
main.ToolbarFile.PressButton('&Tools')
time.sleep(1)
main.TypeKeys('{UP}{ENTER}')

app.InternetOptions.Wait('ready')
app.InternetOptions.TabControl.Select('Connections')

嗯,是的, 有到pywinauto的鏈接 但是上面的代碼在pywinauto的開發版本上進行了檢查,因此原始pywinauto 0.4.2可能無法正確找到“ ToolbarFile”(請改用“ Toolbar3”)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM