- web scraping with Pandas, Beautiful Soup, and Splinter using Jupyter Notebook
- creating an app to display the data retrieved using MongoDB with Flask
- end user can easily retrieve the latest information with a simple click
View web scraping in action here.
- NASA Mars News Site with recent news items about Mars.
- NASA Space Images Site with Mars Images from the Jet Propulsion Laboratory at California Institute of Technology.
- Space Facts Site with a Mars planet profile.
- USGS Site with images of each of Mars' four hemispheres.
Initial web scraping was done in a Jupyter notebook that can be viewed here.
The Jupyter notebook was converted into a Python script that can be viewed here. It defined a scrape
function to execute scraping code and return a Python dictionary that contains the scraped data.
Created an app using Flask, with code that can be viewed here. The root route queries the Mongo database and passes the Mars data into an HTML template to display on a webpage. The /scrape
route imports the Python script and calls the scrape function to retrieve new data when the user clicks the "Scrape New Data" button on the page.
The information updates with each click of the "Scrape New Data" button. The most striking retrieval is the "Featured Mars Image."
Featured Image retrieved | updated Featured Image |
---|---|