Я хочу посетить список URL-адресов (около 3000), чтобы добавить их в историю браузера в Firefox.Я пытаюсь сделать с Selenium, но он не работает.
name = "C:\Users\Default\AppData\Roaming\Mozilla\Firefox\Profiles\2ccgbbg0.default"
profile = webdriver.FirefoxProfile(profile_directory=name)
driver = webdriver.Firefox(firefox_profile=profile)
driver.get("http://www.python.org")
Программа занимает минуты, чтобы создать профиль и выдает следующую ошибку при попытке сделать драйвер.
Traceback (most recent call last):
File "C:/Users/Default/Documents/selenium_test.py", line 7, in <module>
driver = webdriver.Firefox(firefox_profile=profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 166, in __init__
capabilities.update(options.to_capabilities())
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\options.py", line 180, in to_capabilities
opts["profile"] = self._profile.encoded
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 180, in encoded
return base64.b64encode(fp.getvalue()).decode('UTF-8')
File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
MemoryError
Что я делаю неправильно?Есть ли лучший способ сделать это?