BLCL的博客小馆

标签 · lxml

首页

关于

归档

loading..
PythonXPathlxml

一日一技:使用Python翻译HTML中的文本字符串

相信大家都用过浏览器的翻译网页功能,例如对于下图这个英文网页:一键翻译成中文以后是这样的:你可能会觉得这个功能很简单,不就是字符串替换吗?那你可以试一试把下面这个HTML片段中的标签下面的英文翻译成中文。其它标签中的不要改动:123<div><p>if you want to parse date and time, your could use <em>datetimeem>, by use this library, you can generate now time by one line code <span>datetime.datetime.now()span> this is so easy.p>div>在标签中的dat..

更多