April 3rd, 2013, 10:38 PM
Is this possible?
Is it possible to construct a python program to scrape data off of a website and save it to different cells in a excel spreadsheet?
April 4th, 2013, 04:51 AM
I think yes it is possible. As an example (among other possibilities) you can take a look at pyExcelator package in order to generate Excel workbooks.
As for extracting data, first of all, it depends on how the script connects to the website and also what is the format of the data. As an example (just to give an idea) take a look at the following:
April 4th, 2013, 10:14 AM
The best way I have found is to use beautifulsoup to scrape the data then write the data to a .csv file.
you can import the .csv file into excel and save it as a spread sheet.
April 5th, 2013, 12:22 AM
Thanks for the suggestions and input. I will take a look at these possibilities. It would save me a lot of time. What I am doing for my girlfriend is going to a business listing site and looking up business and entering there company info into a spreadsheet. So it would be excellant to have a program to help me with this! Thanks
April 5th, 2013, 05:35 AM
I've done something similar myself in the past and beautiful soup is the way to go.
Just remember not to be too brutal to the sites you are scraping. I never hit them more than once a second and I always try to obey the sites robots.txt file. It's just polite to do so.
You also need to understand EXACTLY how the site is structured in order to get the information you want.
After that it's just a case of writing out the information into a CSV file.