Spaces:
Sleeping
Sleeping
arxivgpt kim
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,10 @@ def take_screenshot(url):
|
|
10 |
options.add_argument('--no-sandbox')
|
11 |
options.add_argument('--disable-dev-shm-usage')
|
12 |
|
|
|
13 |
try:
|
14 |
wd = webdriver.Chrome(options=options)
|
15 |
-
wd.set_window_size(
|
16 |
wd.get(url)
|
17 |
wd.implicitly_wait(10)
|
18 |
screenshot = wd.get_screenshot_as_png()
|
@@ -27,7 +28,7 @@ def take_screenshot(url):
|
|
27 |
iface = gr.Interface(
|
28 |
fn=take_screenshot,
|
29 |
inputs=gr.inputs.Textbox(label="Website URL", default="https://korating.com"),
|
30 |
-
outputs=gr.Image(type="pil", height=
|
31 |
title="Website Screenshot",
|
32 |
description="Take a screenshot of a website.",
|
33 |
)
|
|
|
10 |
options.add_argument('--no-sandbox')
|
11 |
options.add_argument('--disable-dev-shm-usage')
|
12 |
|
13 |
+
wd = None
|
14 |
try:
|
15 |
wd = webdriver.Chrome(options=options)
|
16 |
+
wd.set_window_size(1920, 1080) # 조정된 윈도우 크기
|
17 |
wd.get(url)
|
18 |
wd.implicitly_wait(10)
|
19 |
screenshot = wd.get_screenshot_as_png()
|
|
|
28 |
iface = gr.Interface(
|
29 |
fn=take_screenshot,
|
30 |
inputs=gr.inputs.Textbox(label="Website URL", default="https://korating.com"),
|
31 |
+
outputs=gr.Image(type="pil", height=540, width=960), # 조정된 이미지 크기
|
32 |
title="Website Screenshot",
|
33 |
description="Take a screenshot of a website.",
|
34 |
)
|