0
Ich habe folgenden Code und es ist nicht möglich, den Fenstertitel "Stack Overflow" zu aktivieren und die f11 an falsche GUI zu senden.Python - warum kann ich den Fenstertitel nicht finden?
Ist das ein Python-Fehler? Warum funktioniert es nicht?
import subprocess
from subprocess import Popen
import win32com.client as comctl
import time
def chromes():
url='https://stackoverflow.com'
cmd='C:/Users/tpt/AppData/Local/Chromium/Application/chrome.exe'
Popen([cmd, url, '--window-position=0,0', '--user-data-dir=C:\\iplay'])
chromes()
time.sleep(5)
wsh =comctl.Dispatch("WScript.Shell")
aa = wsh.AppActivate("Stack Overflow")
wsh.SendKeys("{F11}")
Wird ein Fehler angezeigt? –
Kein Fehler. auch versucht: 'von pywinauto.findwindows import find_window von pywinauto.win32functions import SetForegroundWindow SetForegroundWindow (find_window (title = 'Stapelüberlauf - Chromium'))' – YumYumYum
youre sicher die Seite innerhalb dieser 5 Sekunden Schlaf geladen? – Simon