View Single Post
Old May 19th, 2006, 5:07 PM   #73
zem52887
Hobbyist Programmer
 
Join Date: May 2006
Posts: 127
Rep Power: 3 zem52887 is on a distinguished road
from urllib2 import urlopen
from BeautifulSoup import BeautifulSoup


industry_url = "http://biz.yahoo.com/ic/110.html"

def get_company_index(industry_url):
        soup  = BeautifulSoup(urlopen(industry_url))
        index_link = soup.fetch("table")[11].fetch("a")[2]
        return index_link['href']

print get_company_index(industry_url)
about time?

however, that's for when industry_url = a specific industry...

I need to add in a for loop if I want it to work in conjunction with the get_industry_url code that you provided, no??
zem52887 is offline   Reply With Quote