2007年12月28日 星期五 17:40
Ò»×Ö·û´®ÀàËÆÏÂÃ涫Î÷£ºÏë°Ñsrc="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" µÈ¶«Î÷¿ìËÙÌáÈ¡³öÀ´£¬ÓÐʲôÏֳɵĺð취£¿ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071228/623daf3e/attachment.htmlsadf asdf asdf
2007年12月28日 星期五 17:43
On Dec 28, 2007 5:40 PM, Youhong Han <python.han在gmail.com> wrote: > 一字符串类似下面东西: >>> > src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > > src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > > asdf > > src="/mediaddd/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > asdf > > > > 想把src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" > 等东西快速提取出来,有什么现成的好办法? > 正则表达式 > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- '''Time is unimportant, only life important! 过程改进乃是开始催生可促生靠谱的人的组织! '''http://zoomquiet.org 博 @ http://blog.zoomquiet.org/pyblosxom/ 维 @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet 豆 @ http://www.douban.com/people/zoomq/ 看 @ http://zoomq.haokanbu.com/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pls. usage OOo to replace M$ Office. http://zh.openoffice.org Pls. usage 7-zip to replace WinRAR/WinZip. http://7-zip.org You can get the truely Freedom 4 software. sadf
2007年12月28日 星期五 18:18
正则熟悉用re,不熟悉也可以使用BeautifulSoup >>> html = '''''' >>> from BeautifulSoup import BeautifulSoup as Soup >>> soup = Soup(html) >>> imgs = soup('img') >>> for img in imgs: print img['src'] /media/upload/fckeditor/Image/DSC_3009_stand.JPG /media/upload/fckeditor/Image/DSC_3009_stand.JPG /mediaddd/upload/fckeditor/Image/DSC_3009_stand.JPG -----Original Message----- From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn]On Behalf Of Zoom.Quiet Sent: Friday, December 28, 2007 5:43 PM To: python-chinese在lists.python.cn Subject: Re: [python-chinese]怎么快速提取字符串中特定字符 On Dec 28, 2007 5:40 PM, Youhong Han <python.han在gmail.com> wrote: > 一字符串类似下面东西: >sadf asdf asdf
>> > src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > > src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > > asdf > > src="/mediaddd/upload/fckeditor/Image/DSC_3009_stand.JPG" /> > asdf > > > > 想把src="/media/upload/fckeditor/Image/DSC_3009_stand.JPG" > 等东西快速提取出来,有什么现成的好办法? > 正则表达式 > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- '''Time is unimportant, only life important! 过程改进乃是开始催生可促生靠谱的人的组织! '''http://zoomquiet.org 博 @ http://blog.zoomquiet.org/pyblosxom/ 维 @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet 豆 @ http://www.douban.com/people/zoomq/ 看 @ http://zoomq.haokanbu.com/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pls. usage OOo to replace M$ Office. http://zh.openoffice.org Pls. usage 7-zip to replace WinRAR/WinZip. http://7-zip.org You can get the truely Freedom 4 software. _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese sadf
Zeuux © 2024
京ICP备05028076号