Spaces:
Paused
Paused
update
Browse files
toolbox/douyin_selenium/tasks/bless_bag_collector.py
CHANGED
|
@@ -4,6 +4,7 @@ import argparse
|
|
| 4 |
from datetime import datetime
|
| 5 |
import logging
|
| 6 |
import json
|
|
|
|
| 7 |
import time
|
| 8 |
from typing import Dict
|
| 9 |
import traceback
|
|
@@ -44,10 +45,11 @@ class BlessBagCollector(object):
|
|
| 44 |
self.flag = f"[{self.room_name}]"
|
| 45 |
|
| 46 |
options = webdriver.ChromeOptions()
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
| 51 |
self.driver = webdriver.Chrome(options=options)
|
| 52 |
self.driver.delete_all_cookies()
|
| 53 |
|
|
|
|
| 4 |
from datetime import datetime
|
| 5 |
import logging
|
| 6 |
import json
|
| 7 |
+
import platform
|
| 8 |
import time
|
| 9 |
from typing import Dict
|
| 10 |
import traceback
|
|
|
|
| 45 |
self.flag = f"[{self.room_name}]"
|
| 46 |
|
| 47 |
options = webdriver.ChromeOptions()
|
| 48 |
+
if platform.system() not in ("Windows", "Darwin"):
|
| 49 |
+
# 可选项:设置为无头模式(不显示浏览器界面)
|
| 50 |
+
options.add_argument('--headless')
|
| 51 |
+
# 添加静音参数
|
| 52 |
+
options.add_argument("--mute-audio")
|
| 53 |
self.driver = webdriver.Chrome(options=options)
|
| 54 |
self.driver.delete_all_cookies()
|
| 55 |
|