调整chrome内容
This commit is contained in:
@@ -82,6 +82,11 @@ def fetch_images(post_url):
|
||||
print(f"帖子 {post_url} 共有 {total_pages} 页")
|
||||
|
||||
options = Options()
|
||||
options.add_argument('--headless') # 使用新的headless模式
|
||||
options.add_argument('--disable-gpu')
|
||||
options.add_argument('--no-sandbox')
|
||||
options.add_argument('--disable-dev-shm-usage') # 添加Linux特定配置
|
||||
|
||||
options.headless = True
|
||||
# 根据操作系统选择不同的ChromeDriver路径处理方式
|
||||
if os.name == 'nt': # Windows
|
||||
|
||||
Reference in New Issue
Block a user