Code Monkey home page Code Monkey logo

tec-data-10-web's Introduction

The Web Orbit

In this challenge we moved away from our traditional data processing for analysis towards a more “scrapy” way of dealing with data from the web. Using our understanding of the DOM, we pulled data from various websites by accessing its HTML elements and redirected it towards our own little web app with support of a NOSQL database.

Summary

After creating various functions to scrape specific websites for Mars data, we created a single Python file to store them.

We can take a look at our script documentation in case we want to call any of the functions individually or just use scrape_all in our app to execute them all.

import scraping
import inspect

print(inspect.getmembers(scraping.get_image_urls)[9][1])
print(inspect.getmembers(scraping.mars_news)[9][1])
print(inspect.getmembers(scraping.mars_facts)[9][1])
Extract all JPEG images and titles from all items in "https://marshemispheres.com/
Scrape all mars news from https://redplanetscience.com/
Get the latest mars facts from https://galaxyfacts-mars.com

After we get the data we can take a look at our mongo database to make sure we stored it correctly.

mongosh --eval "show dbs" | grep mars_app
mars_app    56.00 KiB

Then inside the shell we can query our collection for documents.

img

Results

Finally, our website is able to visit and scrape the webpages we set it up to scrape after pressing the Scrape New Data button. We also included more Bootstrap styling and added support for mobile displays.

img

img

Conclusion

Web technologies are definitely the easiest and most convenient way to share data visualization and information in this day and age. We managed not only to deal with the front-end part of it but also provide endpoints for user interactivity and even connecting to existing websites. Good thing that Python supports all of that.

tec-data-10-web's People

Contributors

albertov5 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.