I am trying to automate the file downloading process with selenium in Python. Until now I succeeded in writing the code to realize it. But there is just a little problem which is pretty disturbing: Each time I launch the program in Firefox (I use webdriver.Firefox()), there is always an OS pop-up which asks me allow the website to use 'Microsoft Office' and blocks the whole program. Since it is an OS problem, I cannot interact with it using selenium...I also tried driver.switch_to_alert() method but it didn't work.
Do you know how to fix it?
Thank you very much!!
解决方案try:
WebDriverWait(driver, 40).until(EC.alert_is_present(),
'Timed out waiting for PA creation ' +
'confirmation popup to appear.')
alert = driver.switch_to.alert()
alert.accept()