tomo2chin2 commited on
Commit
f861419
·
verified ·
1 Parent(s): e399e9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -26,10 +26,8 @@ def capture_screenshot(html_content, width=1280, height=720):
26
  chrome_options.add_argument("--disable-dev-shm-usage") # /dev/shm を使わないようにする
27
  chrome_options.add_argument(f"--window-size={width},{height}") # ウィンドウサイズ
28
 
29
- #chromedriverのパスを指定(環境変数から取得)
30
- chromedriver_path = os.environ.get("CHROMEDRIVER_PATH")
31
- if not chromedriver_path:
32
- raise ValueError("CHROMEDRIVER_PATH 環境変数が設定されていません。")
33
 
34
  # Chrome WebDriver を初期化
35
  driver = webdriver.Chrome(executable_path=chromedriver_path, options=chrome_options)
 
26
  chrome_options.add_argument("--disable-dev-shm-usage") # /dev/shm を使わないようにする
27
  chrome_options.add_argument(f"--window-size={width},{height}") # ウィンドウサイズ
28
 
29
+ #chromedriverのパスを指定(/usr/bin/chromedriver が標準)
30
+ chromedriver_path = "/usr/bin/chromedriver" # Hugging Face Spacesの標準パス
 
 
31
 
32
  # Chrome WebDriver を初期化
33
  driver = webdriver.Chrome(executable_path=chromedriver_path, options=chrome_options)