View Single Post
Old May 24th, 2006, 10:20 AM   #148
zem52887
Hobbyist Programmer
 
Join Date: May 2006
Posts: 127
Rep Power: 3 zem52887 is on a distinguished road
Before I attempt financial highlights I was wondering if you could look check my progress... I've tested it and I think I've isolated the actual data as opposed to the table, but I just want to be sure.

        soup = BeautifulSoup(urlopen(company_url))
        #Company Profile - Table
        profile = soup.fetchText(re.compile("Company Profile"))[2]
        companyprofile = profile.findNext("table")
        #Description
        description = companyprofile.fetch("td")
        
        #Contact Information - Table
        contact = soup.firstText(re.compile("Contact Information"))
        contacttable = contact.findParent("table")
        #Address
        address = contacttable.firstText(re.compile("Address:"))
        add = address.findParent("tr")
        #Phone
        phone = contacttable.firstText(re.compile("Phone:"))
        phonenumber = phone.findParent("tr")
        #Fax
        fax = contacttable.firstText(re.compile("Fax:"))
        faxnumber = fax.findParent("tr")

Will the above code be enough to import into excel?
zem52887 is offline   Reply With Quote