Spaces:
Paused
Paused
Update screenshot.py
Browse files- screenshot.py +2 -2
screenshot.py
CHANGED
|
@@ -8,7 +8,7 @@ import uuid
|
|
| 8 |
driver_type = 'chromedriver'
|
| 9 |
driver=False
|
| 10 |
|
| 11 |
-
def create_ss(graph,width=
|
| 12 |
uid=uuid.uuid4()
|
| 13 |
code_out=""
|
| 14 |
for ea in graph.split("\n"):
|
|
@@ -29,7 +29,7 @@ def create_ss(graph,width=4000,height=8000):
|
|
| 29 |
html=driver.page_source
|
| 30 |
print(html)
|
| 31 |
driver.implicitly_wait(int(wait_time*30))
|
| 32 |
-
|
| 33 |
obj = driver.find_element(By.ID, "chart")
|
| 34 |
screenshot = obj.screenshot(f'{uid}-tmp.png')
|
| 35 |
return(f'{uid}-tmp.png')
|
|
|
|
| 8 |
driver_type = 'chromedriver'
|
| 9 |
driver=False
|
| 10 |
|
| 11 |
+
def create_ss(graph,width=1000,height=8000):
|
| 12 |
uid=uuid.uuid4()
|
| 13 |
code_out=""
|
| 14 |
for ea in graph.split("\n"):
|
|
|
|
| 29 |
html=driver.page_source
|
| 30 |
print(html)
|
| 31 |
driver.implicitly_wait(int(wait_time*30))
|
| 32 |
+
driver.set_window_size(int(width), int(height))
|
| 33 |
obj = driver.find_element(By.ID, "chart")
|
| 34 |
screenshot = obj.screenshot(f'{uid}-tmp.png')
|
| 35 |
return(f'{uid}-tmp.png')
|