У меня всегда есть бесплатный экземпляр Oracle Cloud с архитектурой aarch64.
Я пытаюсь запустить базовый скрипт селена, но у меня возникают проблемы с использованием geckodriver с селеном.
uname -m
aarch64
Вот мой код:
from selenium import webdriver
from selenium.webdriver import FirefoxOptions
from selenium.webdriver.firefox.service import Service
print("init")
options = FirefoxOptions()
options.add_argument("--headless")
options.add_argument("--disable-blink-features=AutomationControlled")
service = Service(executable_path="/usr/local/bin/geckodriver")
driver = webdriver.Firefox(options=options, service=service)
print("Driver ok")
driver.get("https://python.org")
print(driver.title)
driver.close()
Я получил эту ошибку при попытке запустить ее (при попытке открыть geckodriver она зависает примерно на 2 минуты, а затем выдает исключение):
python3 prueba.py
init
Traceback (most recent call last):
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 536, in _make_request
response = conn.getresponse()
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connection.py", line 507, in getresponse
httplib_response = super().getresponse()
File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
response.begin()
File "/usr/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.10/http/client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.10/socket.py", line 705, in readinto
return self._sock.recv_into(b)
TimeoutError: timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/python/selenium/prueba.py", line 10, in
driver = webdriver.Firefox(options=options, service=service)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 238, in __init__
self.start_session(capabilities)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 325, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in execute
response = self.command_executor.execute(driver_command, params)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 391, in execute
return self._request(command_info[0], url, body=data)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 415, in _request
response = self._conn.request(method, url, body=body, headers=headers, timeout=self._client_config.timeout)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/_request_methods.py", line 143, in request
return self.request_encode_body(
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/_request_methods.py", line 278, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/poolmanager.py", line 443, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/util/retry.py", line 474, in increment
raise reraise(type(error), error, _stacktrace)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/util/util.py", line 39, in reraise
raise value
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 538, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 369, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=45189): Read timed out. (read timeout=120)
Ubuntu:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
Геккодрайвер:
geckodriver -V
geckodriver 0.35.0 (9f0a0036bea4 2024-08-03 07:11 +0000)
The source code of this program is available from
testing/geckodriver in https://hg.mozilla.org/mozilla-central.
This program is subject to the terms of the Mozilla Public License 2.0.
You can obtain a copy of the license at https://mozilla.org/MPL/2.0/.
Firefox:
$ firefox-esr -V
Mozilla Firefox 128.4.0esr
Python:
python3 --version
Python 3.10.12
Пакеты Python:
pip list
Package Version
------------------ -----------
attrs 24.2.0
certifi 2024.8.30
charset-normalizer 3.4.0
exceptiongroup 1.2.2
h11 0.14.0
idna 3.10
outcome 1.3.0.post0
pip 22.0.2
PySocks 1.7.1
requests 2.32.3
selenium 4.26.1
setuptools 59.6.0
sniffio 1.3.1
sortedcontainers 2.4.0
trio 0.27.0
trio-websocket 0.11.1
typing_extensions 4.12.2
urllib3 2.2.3
websocket-client 1.8.0
wsproto 1.2.0
Подробнее здесь: https://stackoverflow.com/questions/791 ... h64-server
Geckodriver не открывается на сервере aarch64 ⇐ Python
Программы на Python
-
Anonymous
1731639113
Anonymous
У меня всегда есть бесплатный экземпляр Oracle Cloud с архитектурой aarch64.
Я пытаюсь запустить базовый скрипт селена, но у меня возникают проблемы с использованием geckodriver с селеном.
uname -m
aarch64
Вот мой код:
from selenium import webdriver
from selenium.webdriver import FirefoxOptions
from selenium.webdriver.firefox.service import Service
print("init")
options = FirefoxOptions()
options.add_argument("--headless")
options.add_argument("--disable-blink-features=AutomationControlled")
service = Service(executable_path="/usr/local/bin/geckodriver")
driver = webdriver.Firefox(options=options, service=service)
print("Driver ok")
driver.get("https://python.org")
print(driver.title)
driver.close()
Я получил эту ошибку при попытке запустить ее (при попытке открыть geckodriver она зависает примерно на 2 минуты, а затем выдает исключение):
python3 prueba.py
init
Traceback (most recent call last):
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 536, in _make_request
response = conn.getresponse()
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connection.py", line 507, in getresponse
httplib_response = super().getresponse()
File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
response.begin()
File "/usr/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.10/http/client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.10/socket.py", line 705, in readinto
return self._sock.recv_into(b)
TimeoutError: timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/python/selenium/prueba.py", line 10, in
driver = webdriver.Firefox(options=options, service=service)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 238, in __init__
self.start_session(capabilities)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 325, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in execute
response = self.command_executor.execute(driver_command, params)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 391, in execute
return self._request(command_info[0], url, body=data)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 415, in _request
response = self._conn.request(method, url, body=body, headers=headers, timeout=self._client_config.timeout)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/_request_methods.py", line 143, in request
return self.request_encode_body(
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/_request_methods.py", line 278, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/poolmanager.py", line 443, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/util/retry.py", line 474, in increment
raise reraise(type(error), error, _stacktrace)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/util/util.py", line 39, in reraise
raise value
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 538, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/home/ubuntu/python/selenium/selenium-env/lib/python3.10/site-packages/urllib3/connectionpool.py", line 369, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=45189): Read timed out. (read timeout=120)
Ubuntu:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
Геккодрайвер:
geckodriver -V
geckodriver 0.35.0 (9f0a0036bea4 2024-08-03 07:11 +0000)
The source code of this program is available from
testing/geckodriver in https://hg.mozilla.org/mozilla-central.
This program is subject to the terms of the Mozilla Public License 2.0.
You can obtain a copy of the license at https://mozilla.org/MPL/2.0/.
Firefox:
$ firefox-esr -V
Mozilla Firefox 128.4.0esr
Python:
python3 --version
Python 3.10.12
Пакеты Python:
pip list
Package Version
------------------ -----------
attrs 24.2.0
certifi 2024.8.30
charset-normalizer 3.4.0
exceptiongroup 1.2.2
h11 0.14.0
idna 3.10
outcome 1.3.0.post0
pip 22.0.2
PySocks 1.7.1
requests 2.32.3
selenium 4.26.1
setuptools 59.6.0
sniffio 1.3.1
sortedcontainers 2.4.0
trio 0.27.0
trio-websocket 0.11.1
typing_extensions 4.12.2
urllib3 2.2.3
websocket-client 1.8.0
wsproto 1.2.0
Подробнее здесь: [url]https://stackoverflow.com/questions/79190988/geckodriver-doesnt-open-in-aarch64-server[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия