Python Selenium – Correction of Error
Currently, the parser works on a local computer and there are no orders. Everything works greatly
But we had the need to launch a script on the server. And after everything was thrown into the server and we try to launch the script there. It is chromium or it is not loaded at all. Or you get a mistake.
https://drive.google.com/drive/u/3/folders/13YDCa5NRllFrQ7ObKGgPx9Kgf8QRSmz8On the link you can see the part of the code responsible for launching the Chrome with profiles. Screenshots of errors
Who knows how to do it, write.
-
866 15 0 Hello to you.
I specialize in Python. I recently made a project on selenium. The fact is that on the server you also need to install the Chrome driver. You are currently trying to use the driver from a local server environment, so there is a mistake.
I propose to transfer the script to Heroku hosting. There are all the necessary tools.
-
Добрый день есть 3 вопроса. 1) Сам хром на сервере стоит? 2) Драйвер селениум стоит? 3) Папка профиля на сервере есть?
-
Версии хрома и драйвера одинаковые? Ну это писали. Библиотеки переносили с помощью requirements.txt или устанавливали через пип?
-
импорты:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
Запуск:
options = Options()
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
-
То есть с монитором работает без не работает?( Или когда запускаете с сервера то работает. А когда через ssh то не работает? )
-
Через screen не пробовали?
-
Олег, кромк путь к драйверу еще нужно добввить путь к профилям
#provide location where chrome stores profiles
options.add_argument(r"--user-data-dir=/home/username/.config/google-chrome")
#provide the profile name with which we want to open browser
options.add_argument(r'--profile-directory=Profile 3')
-
Олег, кромк путь к драйверу еще нужно добввить путь к профилям
===
Олег, кроме путь к драйверу еще нужно добавить путь к профилям
😁
-
вот цю строку закоментуйте: option.add_argument(rf'user-data-dir={path}') -
Current freelance projects in the category Python
A bot needs to be created in Telegram for subscription payment.
45 USD
A bot needs to be created in Telegram where users can subscribe for access to the webcams located in the yard. Organize payment for two types of subscriptions (monthly and daily) in the bot. The bot should automatically check the payment and then provide access links. Python, Bot Development ∙ 12 hours 15 minutes back ∙ 62 proposals |
Parsing and classification of a large array of imagesIt is necessary to implement a project for collecting and structuring a large array of architectural images from open web sources.The task includes: automated collection of images; uploading files in the highest available quality; classification of images by categories:… Python, Data Parsing ∙ 19 hours 15 minutes back ∙ 30 proposals |
Business logic of the platform: class confirmation, attendance control, and lesson history (DjangoRefinement of the business logic of the educational platform: lesson confirmation, attendance control, and lesson history (Django + React) A complete system for lesson confirmation, attendance control, and storage of confirmation history needs to be implemented. Important… Python ∙ 3 days back ∙ 29 proposals |
Improvement of the administrative panel of the educational platform (Django + React)Improvement of the administrative panel of the educational platform (Django + React) Project description: There is an existing educational platform (marketplace, similar to Preply), developed on Django + React. It is required to enhance the existing administrative panel and… Python, Web Programming ∙ 4 days 21 hours back ∙ 58 proposals |
Data collection script (JS execution)Good day, there is a list of links to 0lx ads, I need a script that will collect the phone number. It appears when you click the "show phone" button. Preferably done in Python, but other options are also okay. How much would it approximately cost and how long would it take? Python, Data Parsing ∙ 5 days 12 hours back ∙ 47 proposals |