selenium启动ie业务系统,登陆成功后,转到查询页面,出现js报错,程序中断

问题遇到的现象和发生背景

想自动查询业务系统数据,必须用ie浏览器,使用selenium3.8 和iedriver 3.8 32位版本,好不容易登陆成功,但是ie出现js报错提示,查询功能未能正常加载,程序报错

问题相关代码,请勿粘贴截图

python
from selenium import webdriver
import time
web = webdriver.Ie()
web.get('https://sso.life.cic.inter/login?service=http%3A%2F%2Flis.life.cic.inter%2Findexlis.jsp')
el0_1 = web.find_element_by_xpath('//*[@id="moreInfoContainer"]/A') 
el0_1.click()
time.sleep(1)
el0_2 = web.find_element_by_id("overridelink") #不管安全提示转到登陆界面
# el = web.find_element_by_css_selector("#overridelink")
el0_2.click()
time.sleep(2)
# frame1_1 = web.find_elements_by_name('fraInterface')
web.switch_to.frame("fraInterface") #转到登陆框架
el1_1 = web.find_element_by_xpath("/html/body/form/div[5]/table/tbody/tr[1]/td[2]/input") #用户名
el1_1.send_keys('******')
el1_2 = web.find_element_by_xpath("/html/body/form/div[5]/table/tbody/tr[3]/td[2]/input") #密码
el1_2.send_keys('******')
el1_3 = web.find_element_by_xpath("/html/body/form/div[5]/table/tbody/tr[5]/td[2]/input") #区域
el1_3.send_keys('******')
el1_4 = web.find_element_by_xpath("/html/body/form/div[5]/table/tbody/tr[10]/td[1]/input") #登陆
time.sleep(3)
el1_4.click()
print("登陆完毕!")
time.sleep(5)
web.switch_to.default_content()
# frame2_1 = web.find_element_by_xpath("/html/frameset/frameset/frameset/frame[2]")
web.switch_to.frame("fraMenu") #转到左侧框架
time.sleep(2)
el2_1 = web.find_element_by_xpath("/html/body/div/div/span/span/span[3]/div/nobr/a") #综合查询
el2_1.click()
time.sleep(2)
el2_2 = web.find_element_by_xpath("/html/body/div/div/span/span/span[3]/span/span[1]/div/nobr/a") #点击零售业务查询
el2_2.click()
web.switch_to.default_content()
web.switch_to.frame("fraInterface") #转到查询框架
time.sleep(2)
print('转到查询框架完毕!') #此处出现报错
el2_3 = web.find_element_by_xpath("/html/body/form/div[2]/table[2]/tbody/tr[1]/td[2]/input")
el2_3.send_keys('861201') #机构
el2_4 = web.find_element_by_xpath("/html/body/form/div[2]/table[2]/tbody/tr[1]/td[4]/input")
el2_4.send_keys('2022-02-16') #签署开始日期
el2_5 = web.find_element_by_xpath("/html/body/form/div[2]/table[2]/tbody/tr[1]/td[6]/input")
el2_5.send_keys('2022-02-16') #签署结束日期
el2_6 = web.find_element_by_xpath("/html/body/form/div[2]/table[2]/tbody/tr[3]/td[6]/input")
el2_6.send_keys('销售渠道')
time.sleep(5)
el2_7 = web.find_element_by_xpath("/html/body/form/div[2]/table[2]/input[1]")
el2_7.click()
el2_8 = web.find_elements_by_xpath('//*[@id="spanPolGridField"]/span')
for i in el2_8:
    print(i.text)




运行结果及报错内容

Traceback (most recent call last):
File "D:/PycharmProjects/202004/aoto_work/selenium练习.py", line 42, in
web.switch_to.default_content()
File "D:\python\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 63, in default_content
self._driver.execute(Command.SWITCH_TO_FRAME, {'id': None})
File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 311, in execute
self.error_handler.check_response(response)
File "D:\python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: None
Message: Modal dialog present

img

我的解答思路和尝试过的方法

换用各种版本iedriver,将ie保护模式全部取消,未解决问题

我想要达到的结果

用selenium正常启动ie查询界面,并查询数据,获取数据。

必须是IE吗,能用其他浏览器吗?