Python Web Scrapper Project

Overview

Web Scrapper

Projeto desenvolvido em python, sobre tudo com Selenium, BeautifulSoup e Pandas é um web scrapper que puxa uma tabela com as principais empresas listadas na bolsa, no site fundamentus e após isso aplica uma série de filtros que são úteis no mundo dos investimentos.

Plataforma disponível:

  • Linux

Componentes

Esse projeto é dividido em 4 partes básicas, sendo elas:

  • main_scrapper.py
  • filter_data.py
  • advanced_scrapper.py
  • utils.py

main_scrapper

Esse código é responsável por pegar os principais dados das empresas listadas na bolsa disponíveis no site fundamentus. Esse dados são transformados em um Data Frame pandas e depois disso ele salva em um arquivo Excel, chamado output.xlsx na pasta excel tables

filter_data

Essa parte do código é responsável por aplicar alguns filtros no output gerado. Removendo empresas com baixa liquides, empresas com Mrg. Ebit negativa e empresas do ramo financeiro, como seguradoras, bancos, etc. Após isso ele ordena por Ev/Ebit. Uma vez que os dados saíram desse filtro, eles já podem ser consultados para saber quais empresas podem ser investidas , levando em consideração as 30 primeiras

(Lembrando que isso foi por meio de algumas pesquisas e eu não posso dizer que você terá lucro nisso, reforçando que a intenção aqui é mostrar o código em python e não uma maneira de ganhar dinheiro)

advanced_scrapper

Essa parte aqui é avançada não por ser código complexos, mas a meu ver foi mais chata de fazer, além de que é a parte do código que mais demora. Nele, eu pego todos os papeis das ações e faço consultas individualizadas para buscar o valor atual ação, lpa e vpa. Após isso, eu uso a fórmula de Ben Graham para calcular o valor intrínseco da empresa (Eu zero as que estiverem com LPA ou VPA negativo, pois preciso calcular uma raíz quadrada). Uma vez que o loop foi finalizado, eu vou gerar um novo data frame apenas com as informações de LPA, VPA, VAlUE e VALUATION (valor intriseco) e gero uma saída em um novo arquivo excel

Para rodar

É necessários os seguintes elementos:

  • Python
  • Pandas
  • Selenium
  • bs4
  • chrome driver (o ques tá presente no pacote é para versão especifica do navegador que uso, mas pode baixar a vesão compatível com seu navegador no seguinte link: Chrome Driver)
cd webscrapper
chmod +x *
./main_scrapper.py 

Considerações Finais

para testar o programa por completo, pode ser que demore bastante pois o advanced scrapper consome muito tempo para buscar todas informações, caso queira ver ele rodando por completo. Sugiro que após executar o primeiro arquivo, você abra o output.xlsx e deixe apenas umas 10-20 linhas que ele executará o programa por completo mais rápido, além disso, após finalizado cada programa, ele vai automaticamente chamar o próximo do fluxo, então tem que ter um pouquinho de atenção.

Toda susgestão é bem vinda, pois é meu primeiro projeto nessa área então não entendo muito das boas práticas ou algo que possa melhorar, etc

Owner
Jordan Ítalo Amaral
Interested in Web development, Cyber Security and Data engineering
Jordan Ítalo Amaral
A python script to extract answers to any question on Quora (Quora+ included)

quora-plus-bypass A python script to extract answers to any question on Quora (Quora+ included) Requirements Python 3.x

Nitin Narayanan 10 Aug 18, 2022
Crawler job that scrapes comments from social media posts and saves them in a S3 bucket.

Toxicity comments crawler Crawler job that scrapes comments from social media posts and saves them in a S3 bucket. Twitter Tweets and replies are scra

Douglas Trajano 2 Jan 24, 2022
Scraping Top Repositories for Topics on GitHub,

0.-Webscrapping-using-python Scraping Top Repositories for Topics on GitHub, Web scraping is the process of extracting and parsing data from websites

Dev Aravind D Satprem 2 Mar 18, 2022
Introduction to WebScraping Workshop - Semcomp 24 Beta

Extrair informações da internet de forma automatizada. Existem diversas maneiras de fazer isso, nesse tutorial vamos ver algumas delas, por meio de bibliotecas de python.

Luísa Moura 19 Sep 11, 2022
A python tool to scrape NFT's off of OpenSea

Right Click Bot A script to download NFT PNG's from OpenSea. All the NFT's you could ever want, no blockchain, for free. Usage Must Use Python 3! Auto

15 Jul 16, 2022
A simple code to fetch comments below an Instagram post and save them to a csv file

fetch_comments A simple code to fetch comments below an Instagram post and save them to a csv file usage First you have to enter your username and pas

2 Jul 14, 2022
A multithreaded tool for searching and downloading images from popular search engines. It is straightforward to set up and run!

🕳️ CygnusX1 Code by Trong-Dat Ngo. Overviews 🕳️ CygnusX1 is a multithreaded tool 🛠️ , used to search and download images from popular search engine

DatNgo 32 Dec 31, 2022
Luis M. Capdevielle 1 Jan 14, 2022
Unja is a fast & light tool for fetching known URLs from Wayback Machine

Unja Fetch Known Urls What's Unja? Unja is a fast & light tool for fetching known URLs from Wayback Machine, Common Crawl, Virus Total & AlienVault's

Sheryar 10 Aug 07, 2022
A command-line program to download media, like and unlike posts, and more from creators on OnlyFans.

onlyfans-scraper A command-line program to download media, like and unlike posts, and more from creators on OnlyFans. Installation You can install thi

185 Jul 23, 2022
抖音批量下载用户所有无水印视频

Douyincrawler 抖音批量下载用户所有无水印视频 Run 安装python3, 安装依赖

28 Dec 08, 2022
CRI Scrape is a tool for get general info about Italian Red Cross in GAIA Platform

CRI Scrape CRI Scrape is a tool for get general info about Italian Red Cross in GAIA Platform Disclaimer This code is only for educational purpose. So

Vincenzo Cardone 0 Jul 23, 2022
The first public repository that provides free BUBT website scraping API script on Github.

BUBT WEBSITE SCRAPPING SCRIPT I think this is the first public repository that provides free BUBT website scraping API script on github. When I was do

Md Imam Hossain 3 Feb 10, 2022
Scrapegoat is a python library that can be used to scrape the websites from internet based on the relevance of the given topic irrespective of language using Natural Language Processing

Scrapegoat is a python library that can be used to scrape the websites from internet based on the relevance of the given topic irrespective of language using Natural Language Processing. It can be ma

10 Jul 06, 2022
A simple django-rest-framework api using web scraping

Apicell You can use this api to search in google, bing, pypi and subscene and get results Method : POST Parameter : query Example import request url =

Hesam N 1 Dec 19, 2021
12306抢票脚本

12306抢票脚本

罐子里的茶 457 Jan 05, 2023
Screen scraping and web crawling framework

Pomp Pomp is a screen scraping and web crawling framework. Pomp is inspired by and similar to Scrapy, but has a simpler implementation that lacks the

Evgeniy Tatarkin 61 Jun 21, 2021
A simple, configurable and expandable combined shop scraper to minimize the costs of ordering several items

combined-shop-scraper A simple, configurable and expandable combined shop scraper to minimize the costs of ordering several items. Features Define an

2 Dec 13, 2021
🕷 Phone Crawler with multi-thread functionality

Phone Crawler: Phone Crawler with multi-thread functionality Disclaimer: I'm not responsible for any illegal/misuse actions, this program was made for

Kmuv1t 3 Feb 10, 2022
A simple Discord scraper for discord bots

A simple Discord scraper for discord bots. That includes sending an guild members ids to an file, Mass inviter for joining servers your bot is in and Fetching all the servers of the bot (w/MemberCoun

3zg 1 Jan 06, 2022