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
AI Commenting Platform for TikTok and Instagram.Project Goal Develop a system that allows managing a large number of TikTok and Instagram accounts and automatically posting relevant comments under selected videos using AI. Main Functionality1. Account Management It is necessary to implement the ability to connect accounts:… AI & Machine Learning, Python ∙ 18 hours 21 minutes back ∙ 13 proposals |
Build a customer classification model1. There is client data in Mongo/SQL (approximately 20,000 entries with raw data). 2. It is necessary to build features and a classification model of clients into behavioral groups based on this data. 3. The project should be completed in Python. AI & Machine Learning, Python ∙ 2 days 12 hours back ∙ 34 proposals |
IT Automation of VAT Reporting
223 USD
It is necessary to develop a system for automating the transfer of sales data from the CRM to the accounting system Wafeq. The system should import bank and payment reports, automatically reconcile payments with invoices, generate invoices for VAT reporting, and minimize manual… AI & Machine Learning, Python ∙ 2 days 18 hours back ∙ 44 proposals |
Account reconciliation tool with the bank, cards, and accountantTechnical Assignment: Tool for Reconciling Accounts with Bank, Cards, and AccountantGeneral Goal A local tool (script/small application in Python) is needed, which is manually run once every 1-2 months on my computer and performs reconciliation between: Invoices I issued to… Python, Desktop Apps ∙ 3 days 6 hours back ∙ 42 proposals |
Automatic video posting on social media according to a scheduleTechnical Assignment (TA) Automatic video publication on social media according to a scheduleProject Description A script/bot (Python preferred, or any other solution of your choice — the main thing is stability and ease of maintenance) is needed, which automatically publishes… Python, Bot Development ∙ 3 days 18 hours back ∙ 59 proposals |