Code Monkey home page Code Monkey logo

crypto-scraping's Introduction

Crypto Scraping

In this project, we are going to scrape crypto.com site to get top 500 performing cryptocurrency and store all data into CSV file with time stamp as file name.

Package Required

Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your POST data. Keep-alive and HTTP connection pooling are 100% automatic, thanks to urllib3.

In computer programming, pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series. It is free software released under the three-clause BSD license.

Beautiful Soup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work.

MySQL Connector/Python enables Python programs to access MySQL databases, using an API that is compliant with the Python Database API Specification v2.0 (PEP 249).

Code Blocks

Web Scraping

import requests
from bs4 import BeautifulSoup

url = 'https://crypto.com/price'
response = requests.get(url)
text = response.text
soup = BeautifulSoup(text, 'html.parser')

MySQL Connection

import mysql.connector

database = mysql.connector.connect(
    host='<host>',
    user='<user>',
    password='<password>',
    database='<database>'
)

SQL Commands

CREATE TABLE `crypto_scraper`.`{table_name}` (
    `Rank` INT NOT NULL,
    `Name` VARCHAR(50) NOT NULL,
    `Price` VARCHAR(20) NOT NULL,
    `24H_Change` VARCHAR(20) NOT NULL,
    `24H_Volume` VARCHAR(20) NOT NULL,
    `Market_Cap` VARCHAR(20) NOT NULL,
    PRIMARY KEY (`Name`)
);'''

crypto-scraping's People

Contributors

arabind-meher avatar

Watchers

James Cloos avatar  avatar

Forkers

jerryespn

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.