selenium.common.exceptions.WebDriverException:消息:目标框架分离
selenium.common.exceptions.WebDriverException: Message: target frame detached
当我启动脚本时,有时会出现此错误。它不会一直发生,我通常只需要再次 运行 脚本就不会再收到此消息。
可能是什么问题?
Traceback (most recent call last):
File "C:\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 927, in page_source
return self.execute(Command.GET_PAGE_SOURCE)['value']
File "C:\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 425, in execute
self.error_handler.check_response(response)
File "C:\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: target frame detached
(Session info: chrome=100.0.4896.127)
Stacktrace:
Backtrace:
Ordinal0 [0x00EC9943+2595139]
Ordinal0 [0x00E5C9F1+2148849]
Ordinal0 [0x00D543F0+1065968]
Ordinal0 [0x00D45A97+1006231]
Ordinal0 [0x00D44AD0+1002192]
Ordinal0 [0x00D450D8+1003736]
Ordinal0 [0x00D45068+1003624]
Ordinal0 [0x00D4B220+1028640]
Ordinal0 [0x00D462AD+1008301]
Ordinal0 [0x00D467C5+1009605]
Ordinal0 [0x00D465AF+1009071]
Ordinal0 [0x00D45BC6+1006534]
Ordinal0 [0x00D4542B+1004587]
Ordinal0 [0x00D452C9+1004233]
Ordinal0 [0x00D558A0+1071264]
Ordinal0 [0x00DAB3BB+1422267]
Ordinal0 [0x00D9B806+1357830]
Ordinal0 [0x00D76086+1204358]
Ordinal0 [0x00D76F96+1208214]
GetHandleVerifier [0x0106B232+1658114]
GetHandleVerifier [0x0112312C+2411516]
GetHandleVerifier [0x00F5F261+560433]
GetHandleVerifier [0x00F5E366+556598]
Ordinal0 [0x00E6286B+2173035]
Ordinal0 [0x00E675F8+2192888]
Ordinal0 [0x00E676E5+2193125]
Ordinal0 [0x00E711FC+2232828]
BaseThreadInitThunk [0x76A1FA29+25]
RtlGetAppContainerNamedObjectPath [0x77007A7E+286]
RtlGetAppContainerNamedObjectPath [0x77007A4E+238]
尝试检查:
- Selenium 已升级到最新可用版本
- Chrome驱动程序和 Chrome 浏览器已更新到最新可用版本
- 或者,如果您使用 Firefox,请检查 GeckoDriver 和 Firefox Browser 是否已更新到最新的可用版本
当我启动脚本时,有时会出现此错误。它不会一直发生,我通常只需要再次 运行 脚本就不会再收到此消息。 可能是什么问题?
Traceback (most recent call last):
File "C:\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 927, in page_source
return self.execute(Command.GET_PAGE_SOURCE)['value']
File "C:\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 425, in execute
self.error_handler.check_response(response)
File "C:\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: target frame detached
(Session info: chrome=100.0.4896.127)
Stacktrace:
Backtrace:
Ordinal0 [0x00EC9943+2595139]
Ordinal0 [0x00E5C9F1+2148849]
Ordinal0 [0x00D543F0+1065968]
Ordinal0 [0x00D45A97+1006231]
Ordinal0 [0x00D44AD0+1002192]
Ordinal0 [0x00D450D8+1003736]
Ordinal0 [0x00D45068+1003624]
Ordinal0 [0x00D4B220+1028640]
Ordinal0 [0x00D462AD+1008301]
Ordinal0 [0x00D467C5+1009605]
Ordinal0 [0x00D465AF+1009071]
Ordinal0 [0x00D45BC6+1006534]
Ordinal0 [0x00D4542B+1004587]
Ordinal0 [0x00D452C9+1004233]
Ordinal0 [0x00D558A0+1071264]
Ordinal0 [0x00DAB3BB+1422267]
Ordinal0 [0x00D9B806+1357830]
Ordinal0 [0x00D76086+1204358]
Ordinal0 [0x00D76F96+1208214]
GetHandleVerifier [0x0106B232+1658114]
GetHandleVerifier [0x0112312C+2411516]
GetHandleVerifier [0x00F5F261+560433]
GetHandleVerifier [0x00F5E366+556598]
Ordinal0 [0x00E6286B+2173035]
Ordinal0 [0x00E675F8+2192888]
Ordinal0 [0x00E676E5+2193125]
Ordinal0 [0x00E711FC+2232828]
BaseThreadInitThunk [0x76A1FA29+25]
RtlGetAppContainerNamedObjectPath [0x77007A7E+286]
RtlGetAppContainerNamedObjectPath [0x77007A4E+238]
尝试检查:
- Selenium 已升级到最新可用版本
- Chrome驱动程序和 Chrome 浏览器已更新到最新可用版本
- 或者,如果您使用 Firefox,请检查 GeckoDriver 和 Firefox Browser 是否已更新到最新的可用版本