[Tutor] Pyton and Webpages
Nelson, Scott
SNelson at midway.com
Tue May 2 03:06:11 CEST 2006
WRT creating the Excel file...
The previously mentioned techniques work great. But, if you want to
start off even simpler, just create a .csv (comma separated value) file
with python's file i/o (there is even a python module to help you with
this if you want). It is just a simple text file that looks something
like this:
Name, Age, Hair
Adam, 23, brown
Don, 19, gray
Biff, 42, blond
Cathy, 35, red
Gary, 99, none
Excel handles these files just fine. You don't get all the fancy
formatting, but this is a good first step.
Good luck
-Scott
-----Original Message-----
From: tutor-bounces at python.org [mailto:tutor-bounces at python.org] On
Behalf Of Kent Johnson
Sent: Monday, May 01, 2006 10:38 AM
Cc: Tutor at python.org
Subject: Re: [Tutor] Pyton and Webpages
Jon Whitehouse wrote:
> Greetings All,
>
> I'm a newbie to python and am curious if I can do the following in
python. I'm
> not asking HOW to do this, just if it is possible before I spend the
time to
> learn python and do it myself.
>
> I want to write a program to go to a webpage, pull the data, and then
place it
> into an excel spreadsheet and then write it to an html file and allow
me to
> also click on the link to the excel spreadsheet.
>
> Is this possible to do with python?
Yes. Some of the pieces you might use are
urllib2 and BeautifulSoup to get the data from the web page
win32com or pyexcelerator to write the Excel file
http://docs.python.org/lib/module-urllib2.html
http://www.crummy.com/software/BeautifulSoup/index.html
http://starship.python.net/crew/mhammond/win32/
http://sourceforge.net/projects/pyexcelerator
Kent
_______________________________________________
Tutor maillist - Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list