吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1158|回复: 1
收起左侧

[求助] 如何解决python email获取邮件原文与邮箱预览的链接不一致

[复制链接]
cuinima 发表于 2021-1-3 11:49
qq邮箱预览的html邮件超链接地址:https://login.hypersecureid.com/auth/realms/HyperID/login-actions/action-token?key=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI0YTNiNDhmMS0zNzc4LTQ5MjItOTJjZi1lOWM5ZjQwYzA1M2UifQ.eyJleHAiOjE2MDk2OTEwODcsImlhdCI6MTYwOTYwNDY4NywianRpIjoiMTAyMzZlZWEtYmJlMy00OWMxLThhYzUtMzc2Y2ZjNzlmMDFhIiwiaXNzIjoiaHR0cHM6Ly9sb2dpbi5oeXBlcnNlY3VyZWlkLmNvbS9hdXRoL3JlYWxtcy9IeXBlcklEIiwiYXVkIjoiaHR0cHM6Ly9sb2dpbi5oeXBlcnNlY3VyZWlkLmNvbS9hdXRoL3JlYWxtcy9IeXBlcklEIiwic3ViIjoiZmE4MTc0NDItZTAxYS00MmU3LTgzYjItZGQzMDM3NzRjY2Y1IiwidHlwIjoidmVyaWZ5LWVtYWlsIiwiYXpwIjoiU3Vnb2lDcnlwdG8iLCJub25jZSI6IjEwMjM2ZWVhLWJiZTMtNDljMS04YWM1LTM3NmNmYzc5ZjAxYSIsImVtbCI6ImN1aWVtYWlsQGJpbmRvcy51dS5tZSIsImFzaWQiOiI4MDI2MzBlMi1mNThlLTQ3NDYtYmQyMS1jZTA0ODk3OWJkNmUuZGQtUVlCQVZmbFUuZjA2MTYxZDYtMTUwNi00MTdlLWFlZDYtOTFiYWI1NzUwNjhkIiwiYXNpZCI6IjgwMjYzMGUyLWY1OGUtNDc0Ni1iZDIxLWNlMDQ4OTc5YmQ2ZS5kZC1RWUJBVmZsVS5mMDYxNjFkNi0xNTA2LTQxN2UtYWVkNi05MWJhYjU3NTA2OGQifQ.Dno9B605es2Z37fb3eVxpLLkJdPR1z_V3if-NWApbsc&client_id=SugoiCrypto&tab_id=dd-QYBAVflU

qq邮箱查看邮件原文:
https://login.hypersecureid.=com/auth/realms/HyperID/login-actions/action-token?key=3DeyJhbGciOiJIUzI1Ni=IsInR5cCIgOiAiSldUIiwia2lkIiA6ICI0YTNiNDhmMS0zNzc4LTQ5MjItOTJjZi1lOWM5ZjQwY=zA1M2UifQ.eyJleHAiOjE2MDk2OTEwODcsImlhdCI6MTYwOTYwNDY4NywianRpIjoiMTAyMzZlZ=WEtYmJlMy00OWMxLThhYzUtMzc2Y2ZjNzlmMDFhIiwiaXNzIjoiaHR0cHM6Ly9sb2dpbi5oeXBl=cnNlY3VyZWlkLmNvbS9hdXRoL3JlYWxtcy9IeXBlcklEIiwiYXVkIjoiaHR0cHM6Ly9sb2dpbi5=oeXBlcnNlY3VyZWlkLmNvbS9hdXRoL3JlYWxtcy9IeXBlcklEIiwic3ViIjoiZmE4MTc0NDItZT=AxYS00MmU3LTgzYjItZGQzMDM3NzRjY2Y1IiwidHlwIjoidmVyaWZ5LWVtYWlsIiwiYXpwIjoiU=3Vnb2lDcnlwdG8iLCJub25jZSI6IjEwMjM2ZWVhLWJiZTMtNDljMS04YWM1LTM3NmNmYzc5ZjAx=YSIsImVtbCI6ImN1aWVtYWlsQGJpbmRvcy51dS5tZSIsImFzaWQiOiI4MDI2MzBlMi1mNThlLTQ=3NDYtYmQyMS1jZTA0ODk3OWJkNmUuZGQtUVlCQVZmbFUuZjA2MTYxZDYtMTUwNi00MTdlLWFlZD=YtOTFiYWI1NzUwNjhkIiwiYXNpZCI6IjgwMjYzMGUyLWY1OGUtNDc0Ni1iZDIxLWNlMDQ4OTc5Y=mQ2ZS5kZC1RWUJBVmZsVS5mMDYxNjFkNi0xNTA2LTQxN2UtYWVkNi05MWJhYjU3NTA2OGQifQ.=Dno9B605es2Z37fb3eVxpLLkJdPR1z_V3if-NWApbsc&client_id=3DSugoiCrypto&tab_id==3Ddd-QYBAVflU
python pop 获取的邮件原文:
https://login.hypersecureid.=
com/auth/realms/HyperID/login-actions/action-token?key=3DeyJhbGciOiJIUzI1Ni=
IsInR5cCIgOiAiSldUIiwia2lkIiA6ICI0YTNiNDhmMS0zNzc4LTQ5MjItOTJjZi1lOWM5ZjQwY=
zA1M2UifQ.eyJleHAiOjE2MDk2OTEwODcsImlhdCI6MTYwOTYwNDY4NywianRpIjoiMTAyMzZlZ=
WEtYmJlMy00OWMxLThhYzUtMzc2Y2ZjNzlmMDFhIiwiaXNzIjoiaHR0cHM6Ly9sb2dpbi5oeXBl=
cnNlY3VyZWlkLmNvbS9hdXRoL3JlYWxtcy9IeXBlcklEIiwiYXVkIjoiaHR0cHM6Ly9sb2dpbi5=
oeXBlcnNlY3VyZWlkLmNvbS9hdXRoL3JlYWxtcy9IeXBlcklEIiwic3ViIjoiZmE4MTc0NDItZT=
AxYS00MmU3LTgzYjItZGQzMDM3NzRjY2Y1IiwidHlwIjoidmVyaWZ5LWVtYWlsIiwiYXpwIjoiU=
3Vnb2lDcnlwdG8iLCJub25jZSI6IjEwMjM2ZWVhLWJiZTMtNDljMS04YWM1LTM3NmNmYzc5ZjAx=
YSIsImVtbCI6ImN1aWVtYWlsQGJpbmRvcy51dS5tZSIsImFzaWQiOiI4MDI2MzBlMi1mNThlLTQ=
3NDYtYmQyMS1jZTA0ODk3OWJkNmUuZGQtUVlCQVZmbFUuZjA2MTYxZDYtMTUwNi00MTdlLWFlZD=
YtOTFiYWI1NzUwNjhkIiwiYXNpZCI6IjgwMjYzMGUyLWY1OGUtNDc0Ni1iZDIxLWNlMDQ4OTc5Y=
mQ2ZS5kZC1RWUJBVmZsVS5mMDYxNjFkNi0xNTA2LTQxN2UtYWVkNi05MWJhYjU3NTA2OGQifQ.=
Dno9B605es2Z37fb3eVxpLLkJdPR1z_V3if-NWApbsc&client_id=3DSugoiCrypto&tab_id=
=3Ddd-QYBAVflU

有大佬知道原因吗 怎么解决这个问题 原文中展示的超链接不是正确的url

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| cuinima 发表于 2021-1-4 08:55
python操作邮件返回的是.eml格式,需要解码,文件正文为html格式
1.获取邮件原文 eml格式
2.解码 https://www.cnblogs.com/sislcb/archive/2008/12/01/1344860.html
3.邮件正文为html格式 etree库解析 通过xpath定位 获取a标签herf属性
解决邮件中超链接地址与预览不一致问题
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 10:45

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表