refactor(配置管理): 将playwright配置替换为chrome路径配置并更新使用说明
更新配置管理器、主窗口界面和使用说明文档,将原有的playwright目录配置改为chrome浏览器路径配置
This commit is contained in:
@@ -26,7 +26,7 @@ class ConfigManager:
|
||||
"fetch_interval": 60,
|
||||
"retry_times": 3,
|
||||
"retry_interval": 5,
|
||||
"playwright_dir": ""
|
||||
"chrome_path": ""
|
||||
},
|
||||
"ui": {
|
||||
"opacity": 0.9,
|
||||
@@ -133,7 +133,7 @@ class ConfigManager:
|
||||
def update_spider(self, target_url: str = None, xpath: str = None,
|
||||
user_agent: str = None, fetch_interval: int = None,
|
||||
retry_times: int = None, retry_interval: int = None,
|
||||
playwright_dir: str = None):
|
||||
chrome_path: str = None):
|
||||
"""更新爬虫配置"""
|
||||
if target_url:
|
||||
self.config["spider"]["target_url"] = target_url
|
||||
@@ -147,8 +147,8 @@ class ConfigManager:
|
||||
self.config["spider"]["retry_times"] = retry_times
|
||||
if retry_interval:
|
||||
self.config["spider"]["retry_interval"] = retry_interval
|
||||
if playwright_dir:
|
||||
self.config["spider"]["playwright_dir"] = playwright_dir
|
||||
if chrome_path:
|
||||
self.config["spider"]["chrome_path"] = chrome_path
|
||||
logger.info("爬虫配置已更新")
|
||||
self.save_config()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user