Mars is one of the most exciting sources of astronomical intrigue to the world; another planet so close we can see it in the night sky, and yet the red planet still holds more mysteries than answers. As such, it is a constant topic of study for NASA. To learn more about Mars and practice coding skills, I built a web scraping tool with BeautifulSoup to retrieve information from NASA's Mars webpage, populate a MongoDB with the scraped data, and host the information in a custom Flask application. The Flask app was hosted locally and screenshots of the final applcation are included below with explanations.
Live data from the internet is much more useful if it can be updated dynamically, and as such, the first piece on the Flask application is the large button at the top of the page, which will actively refresh the data from NASA's webpage. The first pieces of data gathered are The Title and Headline of NASA's featured Mars article, their featured image of the day, and a table of statistical facts about the red planet.
The next piece of information to be gathered was URLs for images of each of Mars' hemispheres. However, the URLs featured on the main page were of low resolution and a function within the Web Scraping tool was written to click on each image and extract the URL for it's full-resolution image from the subsequent page. It then would reroute to the previous page, and continue the process for each hemisphere.
The tail end of the Flask application featuring the full resolution images for the last two hemispheres.