import os,urllib,urllib2 import re,sys
url = "http://jt.sz.bendibao.com/bus/linesearch.aspx?line=615&x=0&y=0" page = urllib.urlopen(url).read() pat = re.compile(r<div class="line"></div>(.*?)<div class="pad8lr lh24 blue_06c">,flags=20) cont = pat.search(page).group(1) cont = re.sub(r<(.*?)>,,cont) print cont
|