Created
July 8, 2013 21:23
-
-
Save addisoneee/5952622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
#This program takes a single string parameter | |
#And will return the corresponding company name | |
def CUSIPLookup(cusipNum): | |
data = urllib2.urlopen('http://activequote.fidelity.com/mmnet/SymLookup.phtml?reqforlookup=REQUESTFORLOOKUP&productid=mmnet&isLoggedIn=mmnet&rows=50&for=bond&by=cusip&criteria='+str(cusipNum)+'&submit=Search') | |
data_string = data.read() | |
start = data_string.find("<tr><td height=\"20\" nowrap><font class=\"smallfont\">") | |
end = data_string[start:].find("</font>") | |
return data_string[start:][51:end] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment