mirror of
https://github.com/zhao-zg/jd-login.git
synced 2026-01-15 15:30:43 +08:00
Update login.py
This commit is contained in:
parent
4d85eccffd
commit
8a9fbd6dc4
11
login.py
11
login.py
@ -71,8 +71,8 @@ async def loginPhone(chromium_path, workList, uid, headless):
|
|||||||
# 判断验证码错误
|
# 判断验证码错误
|
||||||
async def isStillInSMSCodeSentPage(page):
|
async def isStillInSMSCodeSentPage(page):
|
||||||
try:
|
try:
|
||||||
button = await page.querySelector('.getMsg-btn.text-btn')
|
button = await page.querySelector('.getMsg-btn.text-btn.timer.active')
|
||||||
if "获取验证码" in button.evaluate("textContent"):
|
if button:
|
||||||
return False
|
return False
|
||||||
return await page.querySelector('#authcode')
|
return await page.querySelector('#authcode')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -164,8 +164,9 @@ async def loginPhone(chromium_path, workList, uid, headless):
|
|||||||
workList[uid].msg = "账号异常,自行检查"
|
workList[uid].msg = "账号异常,自行检查"
|
||||||
break
|
break
|
||||||
if False == sms_sent:
|
if False == sms_sent:
|
||||||
button = await page.querySelector('.getMsg-btn.text-btn')
|
getMsg-btn text-btn timer active
|
||||||
if button and "获取验证码" not in (await button.getProperty("textContent")):
|
button = await page.querySelector('.getMsg-btn.text-btn.timer.active')
|
||||||
|
if button is None:
|
||||||
print("进入直接发短信分支")
|
print("进入直接发短信分支")
|
||||||
if not workList[uid].isAuto:
|
if not workList[uid].isAuto:
|
||||||
workList[uid].status = "SMS"
|
workList[uid].status = "SMS"
|
||||||
@ -199,7 +200,6 @@ async def loginPhone(chromium_path, workList, uid, headless):
|
|||||||
print("异常退出")
|
print("异常退出")
|
||||||
print(e)
|
print(e)
|
||||||
await browser.close()
|
await browser.close()
|
||||||
await deleteSession(workList, uid)
|
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
print("任务完成退出")
|
print("任务完成退出")
|
||||||
@ -391,7 +391,6 @@ async def loginPassword(chromium_path, workList, uid, headless):
|
|||||||
print("异常退出")
|
print("异常退出")
|
||||||
print(e)
|
print(e)
|
||||||
await browser.close()
|
await browser.close()
|
||||||
await deleteSession(workList, uid)
|
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
print("任务完成退出")
|
print("任务完成退出")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user