網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
通過(guò)第三方批處理getmail可以獲取到郵箱里的郵件。獲取后經(jīng)其自身解碼,得到一個(gè)Extract*.out文件,大致看一下其格式應(yīng)該為html的寫法,并且內(nèi)容只分一行。
<div dir="auto">here is the content</div>
顯然我郵件發(fā)送的原內(nèi)容為:
here is the content
現(xiàn)在要提取出其中的原內(nèi)容并且將所有內(nèi)容合并到一行。問(wèn)題在于,郵箱不一定每次都接收到這樣簡(jiǎn)單的文件。例如內(nèi)容當(dāng)中出現(xiàn)換行:
<div dir="auto">abababababababab<br /><br />abababababababab<br /><br /></div>
有時(shí)內(nèi)容含特殊字符,解碼之后也無(wú)法正常顯示(某些字符):
i wanna get these words # $ % & * @ ? !
<div dir="auto">i wanna get these words # $ % & * @ ? !</div>
有時(shí)發(fā)送的內(nèi)容經(jīng)過(guò)復(fù)制粘貼,不小心留下了其他信息:
<div dir="auto">hey get it <span style="font-family:sans-serif">hey get it </span><br style="font-family:sans-serif" /><span style="font-family:sans-serif">hey get it </span><span style="font-family:sans-serif">hey get it </span><br style="font-family:sans-serif" /></div>
顯然需要忽略<>標(biāo)簽里的所有內(nèi)容才能得到原內(nèi)容,并且需要還原未正常顯示的符號(hào)。
可能要用到第三方了……
原文鏈接:http://www.bathome.net/viewthread.php?from=notice&tid=64776
相關(guān)推薦
- 2022-02-27 Redux及React-redux的簡(jiǎn)單使用
- 2022-08-12 python封裝成exe的超詳細(xì)教程_python
- 2022-08-13 beginInvoke加回調(diào)函數(shù)lamad
- 2022-04-25 C#關(guān)于Func和Action委托的介紹詳解_C#教程
- 2022-06-07 Sphinx生成python文檔示例圖文解析_python
- 2021-11-26 Linux下查看IP地址不顯示解決辦法_Linux
- 2023-07-22 macos通過(guò)homebrew安裝多版本node
- 2022-09-03 Go語(yǔ)言中的變量和常量_Golang
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支