Python

your_name your_email_address at upenn.edu
Thu Jan 31 21:37:58 EST 2002


I'm trying to write a Python script that looks up the current value of
the NASDAQ on 2 different webpages and compares the values.  I'm having
some difficulties in figuring out how to grab the index values off of
the websites.  The codes i'm familar with are below.  any suggestions?


import urllib
cnnnasdaq="http://money.cnn.com/markets/nasdaq.html"
cnnpage=urllib.urlopen(cnnnasdaq).read()


sandpindex=re.search(r'(S&P 500)(.*?)(\d+\d+)', data,
re.IGNORECASE|re.DOTALL)



More information about the Python-list mailing list