Inspiration

We were inspired by what you could do with python's web scraping abilities. Both of us are very new to python and wanted to see what was possible.

What it does

It takes input from the user, asking for a specified city, and displays the 10-day temperature forecast in a graph. This graph is then projected on a website.

How we built it

We used python along with other third-party libraries to make our application possible. We used the googlesearch python library to handle inquiries of the city specified by the user. We used the first search result which was on weather.com's website. We then used beautifulsoup to extract the dates and temperature from the html data from the site. With this data, we used matplotlib to graph plot this data on a line graph. We used the flask framework to display this graph on a website using a basic html template.

Challenges we ran into

Our biggest challenge was projecting our graph onto a website. We couldn't figure out how to turn our matplotlib graph into a picture file (ex: png, jpg, jpeg). We spent a lot of time searching online for how to fix this and found that we could fix this by encoding and decoding the figure data. Additionally, we had no experience with most of the libraries we used so we had to read through the documentation extensively.

Accomplishments that we're proud of

We were extremely happy that we could extract data from a website using a program. We were also happy that we were able to manipulate that data into a graph, and successfully display it on a website (on our local machine).

What we learned

How to use python's googlesearch library to perform a search inquiry, how to use beautifulsoup to web scrape data, and how to create a website using the flask framework.

What's next for 10-Day Temperature Forecast

We want to figure out how to add a textbox on the site where a user could enter a city and the graphical figure updates. We also want to figure out how to make it a publicly accessible domain.

Built With

Share this project:

Updates