Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168695
Image: ubuntu2004
import re import urllib2 site = urllib2.urlopen("http://www.internetautoguide.com/cost-of-ownership/09-int/2007/honda/civic/index.html") site_text = site.read() rows = re.findall('<td class="bgrnd17.*td>', site_text) for row in rows: row_data = re.findall('>([^<]*)<',row)[0::2] htc = re.findall('<td .*Hybrid Tax Credit</td>.*>([^<]*)</td>', site_text ) print htc, row_data
['N/A'] ['Cost Per Year', '$4,914', '$4,405', '$4,304', '$4,930', '$4,635', '$23,188']