Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,6 @@ def run_script(url: str, height: int, width: int, check_b,check_h):
|
|
| 44 |
if is_url:
|
| 45 |
options = webdriver.ChromeOptions()
|
| 46 |
options.add_argument('--headless')
|
| 47 |
-
options.add_argument('--force-dark-mode')
|
| 48 |
options.add_argument('--no-sandbox')
|
| 49 |
options.add_argument('--disable-dev-shm-usage')
|
| 50 |
mes='<center>operation success'
|
|
@@ -65,6 +64,8 @@ def run_script(url: str, height: int, width: int, check_b,check_h):
|
|
| 65 |
print (page.get_attribute('theme'))
|
| 66 |
|
| 67 |
main_head = driver.find_element(By.CLASS_NAME, "main-content-header")
|
|
|
|
|
|
|
| 68 |
head_shot = main_head.screenshot(f'head-{uid}-tmp.png')
|
| 69 |
|
| 70 |
obj = driver.find_element(By.CLASS_NAME, "main")
|
|
|
|
| 44 |
if is_url:
|
| 45 |
options = webdriver.ChromeOptions()
|
| 46 |
options.add_argument('--headless')
|
|
|
|
| 47 |
options.add_argument('--no-sandbox')
|
| 48 |
options.add_argument('--disable-dev-shm-usage')
|
| 49 |
mes='<center>operation success'
|
|
|
|
| 64 |
print (page.get_attribute('theme'))
|
| 65 |
|
| 66 |
main_head = driver.find_element(By.CLASS_NAME, "main-content-header")
|
| 67 |
+
driver.execute_script("arguments[0].theme='gab-black';",main_head)
|
| 68 |
+
|
| 69 |
head_shot = main_head.screenshot(f'head-{uid}-tmp.png')
|
| 70 |
|
| 71 |
obj = driver.find_element(By.CLASS_NAME, "main")
|