#coding=utf-8
#-*- coding: UTF-8 -*-
import re
import urllib
def main():
urls = ['http://www.forbeschina.com/review/201301/0022393.shtml',
'http://www.forbeschina.com/review/201301/0022393_2.shtml',
'http://www.forbeschina.com/review/201301/0022393_3.shtml',
'http://www.forbeschina.com/review/201301/0022393_4.shtml',
'http://www.forbeschina.com/review/201301/0022393_5.shtml',
'http://www.forbeschina.com/review/201301/0022393_6.shtml']
for url in urls:
f = urllib.urlopen(url)
html = f.read()
content = re.compile(u'<div class="p_detail">.*?</div>', re.DOTALL)
style = content.search(html.decode('utf8'))
if style:
html = style.group(0)
print 'Found it'
else:
print 'Not found.'
para = re.sub('<[^>]*>', '', html);
print para.encode('utf8')
if __name__ == "__main__":
main()