被告知与Python请求一起死亡(Illy.net阅读电子邮件)

2024-04-26 05:22:48 发布

您现在位置:Python中文网/ 问答频道 /正文

因此,我正在尝试删除我当前的电子邮件,可以通过(https://ically.net/mail.php)访问,同时尝试删除此网站

headers = {'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"}
email = "icall3.amfoamfom@mf.net" #just some random email
def readEmail(email):
    s = requests.Session()
    logger.info(f"Using: {email}")
    encodedBytes = base64.b64encode((str(email)).encode("utf-8"))
    base = str(encodedBytes, "utf-8")
    url = f"https://ically.net/#/{base}"

    resp = s.get("https://ically.net/user.php",data={"user":email},headers=headers)
    resp.raise_for_status()
    resp = s.get("https://ically.net/mail.php?unseen=1",data={"unseen":1},headers=headers)
    resp.raise_for_status()
    resp = s.get("https://ically.net/mail.php")
    resp.raise_for_status()
    print(resp.text)


我最终保留了相同的cookies,因为我没有更改我的电子邮件地址,它应该会显示我的最新电子邮件,但是当我提出此请求时,我的输出是DIE。感觉有点刺耳。不管怎样,我想寻求帮助,看看我是否能改进我正在尝试做的事情。(我更愿意继续使用请求库,而不是使用bs4来完成我正在做的事情)

响应标题:

"{'Server': 'nginx', 'Date': 'Sun, 15 Mar 2020 04:44:32 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Content-Length': '23', 'Connection': 'keep-alive', 'X-Powered-By': 'PHP/7.0.33, PleskLin', 'Expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'Cache-Control': 'no-store, no-cache, must-revalidate', 'Pragma': 'no-cache', 'Set-Cookie': 'PHPSESSID=f5m6q05nutvkoon1rn432l8ke1; path=/', 'Vary': 'Accept-Encoding', 'Content-Encoding': 'gzip'}
[Finished in 2.4s]"

Tags: httpsforgetnet电子邮件emailstatusmail
2条回答

URL只是一个空页面,代码没有问题

你试过用https://ically.net/#/mail.php代替https://ically.net/mail.php

您当前的代码没有指定任何要查看的电子邮件地址,因此有必要做出严厉的回应

如果您转到licy.net,打开浏览器的网络检查器并键入电子邮件地址,您可以看到有一个GET请求,例如https://ically.net/user.php?user=something%40iron.ically.net,然后是https://ically.net/mail.php?unseen=1请求

如果您在同一个requests会话中发出这两个请求(以跟踪cookies),事情可能会有所不同

import requests
sess = requests.Session()
# if you like, enable this...
# sess.headers["user-agent"] = "something/something"
resp = sess.get("https://ically.net/user.php", params={"user": "something@iron.ically.net"})
resp.raise_for_status()
resp = sess.get("https://ically.net/mail.php")
resp.raise_for_status()
print(resp.text)

相关问题 更多 >