Skip to main content

Package for web-scrapping companies from B3Bovespa

Project description

B3Bovespa

This repository scraps all the companies listed on the Bovespa B3 using Selenium.

Drivers

To allow web scrapping, it is necessary to download the driver accordingly to your preferred browser. Currently, the only supported browsers are Chrome and Firefox.

It is necessary that the driver's version is compatible with the current version of the installed browser.

Installation

The package could be installed via pip

pip install b3bovespa

It will install as dependencies Selenium (used for the web scrapping), Pandas (used to handle the output data) and tqdm (used for progress tracking).

Usage

B3Bovespa package is based on the B3Scrapper class, which will control the web scrapping of the Bovespa website. The web-scrapping is really straight-forward, you will need to instantiate a B3Bovespa object, passing the path of the browser driver (as discussed in here), the chosen driver (B3Bovespa supports both Firefox and Chrome) and the output path to export the company list on a CSV format.

from b3bovespa import B3Scrapper

DRIVER_PATH = 'path/to/drive'
b3 = B3Scrapper(path=DRIVER_PATH, browser="Chrome", output_path="/usr/companies/")

With the B3Scrapper object, it is simple to get the information from all the companies listed on Bovespa, a simple call to get_companies_data() will return a Pandas Dataframe containing all the info.

The get_companies_data() will also save a csv file containing all the information on the output path given to the object. If no output path was given, it will just save a csv file on the file directory.

companies = b3.get_companies_data()

If necessary, it is possible to close the current session of the driver by calling the close() method.

b3.close()

Change Log

[0.1] - 2020-08-18

  • Creating the base code for web scrapping
  • Adding Chrome and Firefox support
  • Adding B3Bovespa as base website for scrapping
  • Adding tqdm progress bar to keep track

[0.1.1] - 2020-08-20

  • Bug fixes: fixing broken import

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

B3Bovespa-0.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

B3Bovespa-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file B3Bovespa-0.1.1.tar.gz.

File metadata

  • Download URL: B3Bovespa-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for B3Bovespa-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4ed9940764da5caaa71d88343ae600cfe51e9e48f5df5c057105971b68512764
MD5 cbf12d2f511e6fbd7006d41ad23eb734
BLAKE2b-256 377f6c7aa4591c557aad92d53b415ac863a7bf165a9d0029dba53ba6ecc8dab5

See more details on using hashes here.

File details

Details for the file B3Bovespa-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: B3Bovespa-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for B3Bovespa-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bddfcb978aedfe5923e450aefe90378eb52b2bf0ce3c2ebef62bb785a0e2be53
MD5 04f371e6b0bece55d327b48c95138d64
BLAKE2b-256 0e5d6a7d6ff7fed8a545fbe310b86818a95d0b0651abea4a2253a98b7fed5027

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page