Skip to main content

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

Release files for B3Bovespa 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for B3Bovespa 0.1.1
File Size Uploaded
B3Bovespa-0.1.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for B3Bovespa 0.1.1
File Interpreter ABI Platform
B3Bovespa-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / B3Bovespa-0.1.1.tar.gz

Download URL B3Bovespa-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4ed9940764da5caaa71d88343ae600cfe51e9e48f5df5c057105971b68512764
BLAKE2b-256 checksum
How to use checksums
377f6c7aa4591c557aad92d53b415ac863a7bf165a9d0029dba53ba6ecc8dab5
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / B3Bovespa-0.1.1-py3-none-any.whl

Download URL B3Bovespa-0.1.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bddfcb978aedfe5923e450aefe90378eb52b2bf0ce3c2ebef62bb785a0e2be53
BLAKE2b-256 checksum
How to use checksums
0e5d6a7d6ff7fed8a545fbe310b86818a95d0b0651abea4a2253a98b7fed5027
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page