soup = BeautifulSoup(html)
profile = soup.fetchText(re.compile("Company Profile"))[2]
companyprofile = profile.findNext("table") jackpot... I think I'm getting the hang of this.
on to Financial Highlights, this one seems like it's going to be a bit more complex than the other types of data grabbing. Since some companies have financial data posted and others don't, it seems an if-statement is necessary (to me at least) however, the examples I've seen are all like the following:
>>> x = int(raw_input("Please enter an integer: "))
>>> if x < 0:
... x = 0
... print 'Negative changed to zero'
... elif x == 0:
... print 'Zero'
... elif x == 1:
... print 'Single'
... else:
... print 'More'
since we're dealing with text and not a numerical value, I obviously can't just put:
if Financial Highlights "exist"
then...
hah, any helpful hints? or am I underestimating BeautifulSoup and if there's no financial highlights will it just skip over it? I assume I have to address it in some way/shape/form.