Skip to content

Commit

Permalink
https://stackoverflow.com/questions/76428561/typeerror-webdriver-init…
Browse files Browse the repository at this point in the history
…-got-multiple-values-for-argument-options
  • Loading branch information
i13302 committed Oct 3, 2023
1 parent b323cbc commit 2bac204
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion printout/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
import json
import base64

Expand All @@ -17,13 +18,14 @@ def send_devtools(driver, cmd, params={}):


def get_pdf_from_html(path, chromedriver='./chromedriver', print_options={}):
service=Service(executable_path=chromedriver)
webdriver_options = Options()
webdriver_options.binary_location = '/usr/bin/google-chrome-beta'
webdriver_options.add_argument('--headless')
webdriver_options.add_argument('--disable-gpu')
webdriver_options.add_argument('--no-sandbox')
webdriver_options.add_argument("--lang=ja")
driver = webdriver.Chrome(chromedriver, options=webdriver_options)
driver = webdriver.Chrome(service=service, options=webdriver_options)

driver.get(path)

Expand Down

0 comments on commit 2bac204

Please sign in to comment.