Spaces:
Paused
Paused
Update app.py
Browse files
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 =
|
| 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)
|