ドライバインスタンスを再起動した後、私はループ内で実行されているPythonのセレンスクリプトは、それがブラウザにこのようなすべての100回の反復を終了しますが...PythonのセレンFirefoxのスクリプトクラッシュ
def init_driver():
ffprofile = webdriver.FirefoxProfile("my_profile");
ffprofile.add_extension(extension="myaddon.xpi")
return driver
driver = init_driver()
for i, item, in enumerate(item_list):
check_item(item)
print ("")
if i == 0:
print ("Ignoring First Item")
elif i % 100 == 0:
driver.quit()
driver = init_driver()
それがランダムに
Traceback (most recent call last):
File "C:\scripts\main.py", line 118, in <module>
driver = init_driver()
File "C:\scripts\main.py", line 98, in init_driver
driver = webdriver.Firefox(firefox_profile=ffprofile)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 78, in __init__
self.binary, timeout)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 49, in __init__
self.profile.add_extension()
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 91, in add_extension
self._install_extension(extension)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 287, in _install_extension
shutil.rmtree(tmpdir)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\shutil.py", line 488, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\shutil.py", line 383, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\john\AppData\Local\Programs\Python\Python35\lib\shutil.py", line 381, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\john\\AppData\\Local\\Temp\\tmpoaizz71l.webdriver.xpi\\platform\\WINNT_x86-msvc\\components\\imehandler.dll'
は、時にはそれがクラッシュすることなく、繰り返しの数千人を通過し、それが起こる他の回100
誰も後にすることができます...エラーでクラッシュ何が起きているのでしょうか?
_ "たまにはたまにしかない" _ _実際にはそうです。 – aneroid