Я бегу тестовый скрипт в Python Селен Firefox и, казалось бы, случайно он выходит из строя из-за ошибки ...Python Селен Firefox понять сообщение об ошибке
Time Elapsed: 104.31666666666666
Traceback (most recent call last):
File "D:\sel_scripts\main.py", line 110, in <module>
source_rf_script(driver, time, randint)
File "D:\sel_scripts\data_sources\myscript.py", line 184, in source_rf_script
htmlText = driver.execute_script("return document.getElementsByTagName('html')[0].innerHTML")
File "C:\Users\user4\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 429, in execute_script
{'script': script, 'args':converted_args})['value']
File "C:\Users\user4\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 201, in execute
self.error_handler.check_response(response)
File "C:\Users\user4\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: waiting for doc.body failed
Stacktrace:
at injectAndExecuteScript/< (file:///C:/Users/user4/AppData/Local/Temp/tmpvbvr8pjg/webdriver-py-profilecopy/extensions/[email protected]/components/driver-component.js:
10678)
at fxdriver.Timer.prototype.runWhenTrue/g (file:///C:/Users/user4/AppData/Local/Temp/tmpvbvr8pjg/webdriver-py-profilecopy/extensions/[email protected]/components/driver
-component.js:629)
at fxdriver.Timer.prototype.setTimeout/<.notify (file:///C:/Users/user4/AppData/Local/Temp/tmpvbvr8pjg/webdriver-py-profilecopy/extensions/[email protected]/components/
driver-component.js:623)
Я пытаюсь выяснить, что является причиной его, для меня это читается, как команда driver.execute_script вызывает сбой. Может быть, когда элементы страницы не могут правильно загрузиться (что иногда происходит на dev-сервере), и команда не может их найти?
Я читаю его правильно?
Не могли бы вы показать остальным код, связанный с инициализацией драйвера, навигацией и всем, что происходит до этого 'execute_script'? Благодарю. – alecxe