启动app会出弹窗for i in range(4): logging.info('=========click 允许===========') try: if ('允许' in driver.page_source or '始终允许' in driver.page_source): driver.switch_to.alert.accept() except: pass