Skip to content

Commit

Permalink
fix: dp bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Aug 24, 2024
1 parent c0059ef commit 574863e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/helper/drissionpage_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ def get_page_html(self,
except Exception as e:
logger.error(f"url: {url} 回调函数执行失败: {e}")
# 嵌入CF处理
if 'TurnstileCallback' in page.html or under_challenge(page.html):
page.wait(15)
logger.debug(f"url: {url} 获取网页源码成功")
content = page.html
try:
content = page.html
if 'TurnstileCallback' in content or under_challenge(content):
page.wait(15)
content = page.html
logger.debug(f"url: {url} 获取网页源码成功")
except Exception as e:
logger.error(f"url: {url} 获取网页源码失败")
page.quit()
else:
logger.error(f"url: {url} 获取网页源码失败")
page.quit()
Expand Down

0 comments on commit 574863e

Please sign in to comment.