Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,7 +57,18 @@ def run_script(url: str, height: int, width: int, check_b,check_h):
|
|
| 57 |
page = driver.find_element(By.TAG_NAME, "html")
|
| 58 |
print (dir(page))
|
| 59 |
print (page.text)
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
main_head = driver.find_element(By.CLASS_NAME, "main-content-header")
|
| 62 |
head_shot = main_head.screenshot(f'head-{uid}-tmp.png')
|
| 63 |
|
|
|
|
| 57 |
page = driver.find_element(By.TAG_NAME, "html")
|
| 58 |
print (dir(page))
|
| 59 |
print (page.text)
|
| 60 |
+
|
| 61 |
+
js="""
|
| 62 |
+
function toggleTheme() {
|
| 63 |
+
if (localStorage.getItem('theme') === 'theme-dark'){
|
| 64 |
+
setTheme('theme-light');
|
| 65 |
+
} else {
|
| 66 |
+
setTheme('theme-dark');
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
"""
|
| 70 |
+
|
| 71 |
+
driver.execute_script(js)
|
| 72 |
main_head = driver.find_element(By.CLASS_NAME, "main-content-header")
|
| 73 |
head_shot = main_head.screenshot(f'head-{uid}-tmp.png')
|
| 74 |
|