View Single Post
Old May 25th, 2006, 5:59 PM   #197
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by zem52887
Arevos, you sir, are great at what you do. Adding in "q?s" solved the ticker problem. However, I took out sys.exit and it's exiting after the first industry.
Hm. If I have time, I'll take a look at that tomorrow.

Quote:
Originally Posted by zem52887
Could we do something like:
for all "q?s" in a['href'] print "yes\n"

would something like that work, and would we be able to put it in it's own cell when embedding the HTML?
Yes... Though you'd need to use findNextSibling or something like that in order to match the company URL to it's ticker-tape symbol.

Something like:
sibling = a.findNextSibling("a")

if sibling and "q?s" in sibling['href']:
   is_public = True

...

return company_url, is_public
The above code demonstrates how to return two values, rather than one. The code below shows you how to get the values from the function:
company_url, is_public = some_function()
I'll explain a little further tomorrow, I think, as I've been a little vague. Though you can always refer back to the tutorial to tell you more

Quote:
Originally Posted by zem52887
also, I fetched the company name from the webpage title (in <title> tags)
so I need a way to make it so that when I return it I'm not returning the title tags but the actual text, otherwise when I embed it in HTML it's not going to display the company name.
You can use tag.string to return the text inside a tag.
Arevos is offline   Reply With Quote