Skip to content

Commit 660fd18

Browse files
committed
fix: dy login fix
1 parent afbd4ec commit 660fd18

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

docs/常见问题.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ A: 该错误为缺少 nodejs 环境,这个错误可以通过安装 nodejs 环
77
Q: 使用Cookie爬取抖音报错: execjs._exceptions.ProgramError: TypeError: Cannot read property 'JS_MD5_NO_COMMON_JS' of null
88
A: windows电脑去网站下载`https://nodejs.org/en/blog/release/v16.8.0` Windows 64-bit Installer 版本,一直下一步即可。
99

10+
## xhs登录出现滑块一直验证不通过问题
11+
12+
Q: 小红书扫码登录成功后,浏览器一直在验证滑块,无法登录?<br>
13+
A: 这种情况一般是因为使用playwright浏览器驱动被识别出来的问题,可以尝试删除项目目录下的`brower_data`文件夹,重新走登录流程。<br>
14+
1015
## 如何指定关键词
1116
Q: 可以指定关键词爬取吗?<br>
1217
A: 在config/base_config.py 中 KEYWORDS 参数用于控制需要爬取的关键词 <br>

media_platform/douyin/login.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async def check_login_state(self):
101101

102102
async def popup_login_dialog(self):
103103
"""If the login dialog box does not pop up automatically, we will manually click the login button"""
104-
dialog_selector = "xpath=//div[@id='login-pannel']"
104+
dialog_selector = "xpath=//div[@id='login-panel-new']"
105105
try:
106106
# check dialog box is auto popup and wait for 10 seconds
107107
await self.context_page.wait_for_selector(dialog_selector, timeout=1000 * 10)
@@ -114,7 +114,7 @@ async def popup_login_dialog(self):
114114

115115
async def login_by_qrcode(self):
116116
utils.logger.info("[DouYinLogin.login_by_qrcode] Begin login douyin by qrcode...")
117-
qrcode_img_selector = "xpath=//article[@class='web-login']//img"
117+
qrcode_img_selector = "xpath=//div[@id='animate_qrcode_container']//img"
118118
base64_qrcode_img = await utils.find_login_qrcode(
119119
self.context_page,
120120
selector=qrcode_img_selector

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author = "程序员阿江-Relakkes <[email protected]>"
44
version = "0.1.0"
55
description = "A social media crawler project, support Xiaohongshu, Weibo, Zhihu, Bilibili, Douyin, BaiduTieBa etc."
66
readme = "README.md"
7-
requires-python = "==3.9"
7+
requires-python = ">=3.9"
88
dependencies = [
99
"aiofiles~=23.2.1",
1010
"aiomysql==0.2.0",

0 commit comments

Comments
 (0)