0 votes
in Python by Beginner (6 points)
Can I use Python to gather data from a website, enter it into a spreadsheet, then email the resultant report daily to a PC?
by Beginner (86 points)
+1
Dear magician59,
    your question is a bit too broad, but here is my suggestion:

1. The Python standard library provides a `urllib` module, which can, among other things, download pages from an HTTP source. That might solve  your first problem of downloading data from a website.

2. The Python standard library provides a `csv` module to handle CSV data, which can be manually loaded into a spreadsheet. How to extract data from the HTML page and convert it into CSV depends on the kind of data you are dealing with. The Python standard library has a `html` package that can parse HTML pages.

3. The Python standard library provides a `smtplib` package that deals with sending e-mails. That would solve your third problem.

If you give some other details on the kind of data you are dealing with, I might give you a better answer.
by Beginner (0 points)
+2

Dear magician,

Of course you can do it all using python.

1. You can use BeautifulSoup to gather data from the website, or alternatively you can use Scrapy framework to achieve the same. Both of these are incredible in their nature and very easy to use.

2. For storing results in Excel files you can use great python library OpenPyXl, this will make your life a lot easier.

3. To send emails you can use smtplib, python's standard email module.

4. To schedule your emails you can use and incredible and very simple schedule library Schedule, and that's it, you're good to go.

1 Answer

0 votes
by Super Expert (3.2k points)
 
Best answer

Question marked as Answered based on majidbilal's comment:

Dear magician,

Of course you can do it all using python.

1. You can use BeautifulSoup to gather data from the website, or alternatively you can use Scrapy framework to achieve the same. Both of these are incredible in their nature and very easy to use.

2. For storing results in Excel files you can use great python library OpenPyXl, this will make your life a lot easier.

3. To send emails you can use smtplib, python's standard email module.

4. To schedule your emails you can use and incredible and very simple schedule library Schedule, and that's it, you're good to go.

Welcome to wellsr Q&A
Ask any questions you have about VBA and Python and our community will help answer them. wellsr Q&A is the standalone question and answer platform for wellsr.com. If you have a question about one of our specific tutorials, please include a link back to the tutorial.

Getting Started
Register
VBA Cheat Sheets (On Sale Now)

Looking for something else? Hire our team directly through ourVBA Help page, instead.

For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.

...