1
paloalto OP 想复杂了,其实就是想用正则过滤。。。。汗。。。貌似我知道该怎么做了。
|
2
CoX 2012 年 11 月 17 日
如果装了lxml,就很简单了
>>> import lxml.html >>> html='<img /><a>srcd</a>hello</br><br/>' >>> html = lxml.html.document_fromstring(html) >>> html.text_content() 'srcdhello' |
4
CoX 2012 年 11 月 17 日
自定个函数,然后传递到view层;
不知道为什么非要在view层处理,实质上还是controller层处理的 |