nacho commited on
Commit
a750d84
·
1 Parent(s): ac9cc0b

fix: 修复点击深度思考按钮时误命中外层div导致点击无效的问题

Browse files
Files changed (1) hide show
  1. deepseek_browser.py +4 -6
deepseek_browser.py CHANGED
@@ -289,8 +289,7 @@ class DeepSeekBrowser:
289
  # 极速思考模式
290
  if 'fast' in model or 'lite' in model:
291
  fast_btn = self.page.locator(
292
- 'button:has-text("极速思考"), div:has-text("思考"), '
293
- 'button:has-text("快速模式"), div:has-text("快速模式")'
294
  ).first
295
  if await fast_btn.count() > 0:
296
  await fast_btn.click()
@@ -298,8 +297,7 @@ class DeepSeekBrowser:
298
  # 深度思考 (DeepThink R1)
299
  elif 'reasoner' in model or 'thinking' in model or 'pro' in model:
300
  thinking_btn = self.page.locator(
301
- 'button:has-text("深度思考"), div:has-text("深度思考"), '
302
- 'button:has-text("DeepThink"), button:has-text("R1")'
303
  ).first
304
  if await thinking_btn.count() > 0:
305
  await thinking_btn.click()
@@ -308,14 +306,14 @@ class DeepSeekBrowser:
308
  # 专家模式 (独立开关)
309
  if 'expert' in model:
310
  expert_btn = self.page.locator(
311
- 'button:has-text("专家模式"), div:has-text("专家模式")'
312
  ).first
313
  if await expert_btn.count() > 0:
314
  await expert_btn.click()
315
  await asyncio.sleep(0.5)
316
 
317
  if 'search' in model:
318
- search_btn = self.page.locator('button:has-text("智能搜索"), div:has-text("智能搜索")').first
319
  if await search_btn.count() > 0:
320
  await search_btn.click()
321
  await asyncio.sleep(0.5)
 
289
  # 极速思考模式
290
  if 'fast' in model or 'lite' in model:
291
  fast_btn = self.page.locator(
292
+ 'text="极速思考", text="模式"'
 
293
  ).first
294
  if await fast_btn.count() > 0:
295
  await fast_btn.click()
 
297
  # 深度思考 (DeepThink R1)
298
  elif 'reasoner' in model or 'thinking' in model or 'pro' in model:
299
  thinking_btn = self.page.locator(
300
+ 'text="深度思考", text="DeepThink", text="R1"'
 
301
  ).first
302
  if await thinking_btn.count() > 0:
303
  await thinking_btn.click()
 
306
  # 专家模式 (独立开关)
307
  if 'expert' in model:
308
  expert_btn = self.page.locator(
309
+ 'text="专家模式"'
310
  ).first
311
  if await expert_btn.count() > 0:
312
  await expert_btn.click()
313
  await asyncio.sleep(0.5)
314
 
315
  if 'search' in model:
316
+ search_btn = self.page.locator('text="智能搜索"').first
317
  if await search_btn.count() > 0:
318
  await search_btn.click()
319
  await asyncio.sleep(0.5)