Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1597 Lượt xem

hello everyone, I am experimenting with a program to run selenium from a wizard in odoo to send messages+attachments via whatsapp, but I get the following error: selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/chromedriver unexpectedly exited. Status code was: -5


I share my code, any ideas or suggestions on how to solve the error would be of great help, or some other option to run selenium outside of odoo,


Thank you very much in advance.


Here is my code:

from selenium import webdriver

from selenium.webdriver.chrome.options import Options

from selenium.webdriver.common.by import By

from selenium.webdriver.common.keys import Keys

from selenium.webdriver.support import expected_conditions

from selenium.webdriver.support.ui import WebDriverWait

from webdriver_manager.chrome import ChromeDriverManager

from selenium.webdriver.chrome.service import Service as ChromeService


service = ChromeService()

browser = webdriver.Chrome(service=service)

browser.maximize_window()

phone = "my_phone_number"

message = 'Hi There. This is test message from PythonCircle.com'

browser.get("https://web.whatsapp.com/send?phone={phone}&text&type=phone_number&app_absent=1".format(phone=phone))

time.sleep(3)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
2020
2
thg 7 25
7532
2
thg 7 25
3971
2
thg 7 25
3716
2
thg 6 25
2302