
1 paloalto OP 2012-11-17 20:25:46 +08:00 想复杂了,其实就是想用正则过滤。。。。汗。。。貌似我知道该怎么做了。 |
2 CoX 2012-11-17 20:39:57 +08:00 如果装了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 20:52:12 +08:00 自定个函数,然后传递到view层; 不知道为什么非要在view层处理,实质上还是controller层处理的 |