php如何实现百度翻译API优化处理

wfshjkg 2018-11-09 09:11:52
最近自己搭建了一个新闻资讯信息网站,因为实在缺少内容信息,所以只能将信息来源瞄准网页爬取数据,但是因为涉及到信息来源是外文网站,需要使用百度翻译API对文字处理,问题是网页上爬取的数据往往包含有html标签,请问有没有用php处理过带html标签的英文的翻译内容
请有优化解决方案的给个建议。
列举文章来源:https://venturebeat.com/infinite?paged=2&tags=category-computers-electronics-consumer-electronics,category-internet-telecom-mobile-wireless-mobile-phones,category-news,category-science-engineering-technology
形式(JSON格式):

例如需要使用百度翻译api的内容是:<p>In the months since the debut of Qualcomm’s <a href="https://venturebeat.com/2018/09/10/qualcoms-new-snapdragon-wear-3100-smartwatch-chipset-delivers-up-to-two-days-of-battery-life/">Snapdragon Wear 3100</a>, its first new high-end wearable chipset in two years, smartwatches sporting the system-on-chip have been conspicuously far and few between. The prohibitively expensive ($995) <a href="https://venturebeat.com/2018/10/15/montblanc-ships-the-first-snapdragon-wear-3100-watch-the-995-summit-2/">Montblanc Summit 2</a> was the first; Louis Vuitton, which launched the $2,500 Tambour Horizon in May 2017, said in early fall that its watch was forthcoming. But there’s finally some good news for smartwatch fans champing at the bit: As of today, an affordable model is joining the lineup.</p>
...全文
201 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

488

社区成员

发帖
与我相关
我的任务
社区描述
硬件使用 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧