Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import random
|
3 |
import gradio as gr
|
4 |
from selenium import webdriver
|
@@ -30,16 +31,13 @@ def main(url):
|
|
30 |
driver.get(url)
|
31 |
else:
|
32 |
driver.get("http://" + url)
|
33 |
-
|
34 |
-
WebDriverWait(driver, 30).until(
|
35 |
-
lambda d: d.execute_script("return document.readyState") == "complete"
|
36 |
-
)
|
37 |
-
|
38 |
page_width = driver.execute_script("return document.body.scrollWidth")
|
39 |
page_height = driver.execute_script("return document.body.scrollHeight")
|
40 |
|
41 |
driver.set_window_size(page_width, page_height)
|
42 |
|
|
|
43 |
filename = str(random.randint(111111111, 999999999)) + ".png"
|
44 |
file_path = os.path.join(os.path.dirname(__file__), filename)
|
45 |
driver.save_screenshot(file_path)
|
|
|
1 |
import os
|
2 |
+
import time
|
3 |
import random
|
4 |
import gradio as gr
|
5 |
from selenium import webdriver
|
|
|
31 |
driver.get(url)
|
32 |
else:
|
33 |
driver.get("http://" + url)
|
34 |
+
|
|
|
|
|
|
|
|
|
35 |
page_width = driver.execute_script("return document.body.scrollWidth")
|
36 |
page_height = driver.execute_script("return document.body.scrollHeight")
|
37 |
|
38 |
driver.set_window_size(page_width, page_height)
|
39 |
|
40 |
+
time.sleep(3)
|
41 |
filename = str(random.randint(111111111, 999999999)) + ".png"
|
42 |
file_path = os.path.join(os.path.dirname(__file__), filename)
|
43 |
driver.save_screenshot(file_path)
|