From 1ab2768918bffb54bfd1daba4f8ec7df7955b82a Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 7 Sep 2024 20:37:23 -0400 Subject: [PATCH] update to selenium 4.11+ Webdriver init code --- pdfoid/backends/direct.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdfoid/backends/direct.py b/pdfoid/backends/direct.py index 04559e7..12163e6 100644 --- a/pdfoid/backends/direct.py +++ b/pdfoid/backends/direct.py @@ -5,8 +5,8 @@ import base64 from contextlib import closing +from selenium.webdriver.chrome.service import Service from tornado import gen -from tornado.process import Subprocess from pdfoid.utils import utf8bytes, utf8text @@ -78,11 +78,12 @@ def get_log(self, driver): @gen.coroutine def html_to_pdf(self, *, header_template, footer_template, wait_for): + service = Service(executable_path=self.backend.chromedriver_path) options = webdriver.ChromeOptions() options.add_argument('--headless') options.binary_location = self.backend.chrome_path - browser = webdriver.Chrome(self.backend.chromedriver_path, options=options) + browser = webdriver.Chrome(service=service, options=options) with closing(browser): browser.get('file://%s' % self.input_html_file)