按钮处理

问题描述 投票:0回答:0

函数打开站点并点击下载exe文件按钮。但是我得到一个带有保留和丢弃按钮的窗口。我该如何处理它们?

def buttonTSDownload(self):
        browser = webdriver.Chrome()
        browser.get('https://www.teamspeak.com/en/downloads/')
        xpath = '/html/body/div[1]/div/div/div/div/div/div[1]/div/div[1]/div[1]/div[2]/div[2]/div/a'
        browser.find_element(By.XPATH, xpath).click()

        file_path = f"C:/Users/{self.nameUsers}/Downloads/TeamSpeak3-Client-win64-3.5.6.exe"
        while not os.path.isfile(file_path):
            time.sleep(1)
        browser.quit()

enter image description here

python pyqt
© www.soinside.com 2019 - 2024. All rights reserved.