The purpose of this project was to write code to utilize an automated web brower to scrape data and images from several websites then store it to a NoSQL database before using Flasks to build a web application. The data was then used to build a web page.
- Python 3.7, Jupyter Notebook 6.4.6, VS Code 1.63.2
- MongoDB, Flask
- HTML5, Bootstrap 3
- A python script was written to perform specified web scraping to collect and format data (raw text strings, image urls, etc). The full code can be viewed in the Mission_to_Mars_Challenge.ipynb file.
- The DevTools was to inspect the respective pages for the correct elements/tags to scrape.
- A scraping.py file was used to store the scraped code for further use/referencing for the flask application. The scraped data was then coded to be stored in a Mongo database
- Flask was then used to create a web application of all the scraped data and a website was then created/modified using an index.html file. This webpage contains all the information collected/scraped.
- Bootstrap was used as the styling reference to create the webpage. It was ensured the page was mobile responsive and where applicable, the html sheet was modified to make the built page more visually appealing.
Collectively
The following list of files contains the relevant information as it pertains to the result from this project. Collectively, the code/script within these files was used to create a web application that can display scraped data including images from several sites.
- The Mission_to_Mars_Challenge.ipynb file contains the code used for scraping.
- An updated scraping.py file containing all the scraping code
- The app.py file used to create the flask app
- The index.html file in the template folder and CSS stylesheets in the static folder.
A preview of the created web app is displayed in the image below.