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
An utility library to scrape data from TikTok, Instagram, Twitch, Youtube, Twitter or Reddit in one line!

Social Media Scraper An utility library to scrape data from TikTok, Instagram, Twitch, Youtube, Twitter or Reddit in one line! Go to the website » Vie

2 Aug 03, 2022
Scrape data on SpaceX: Capsules, Rockets, Cores, Roadsters, SpaceX Info

SpaceX Sofware I developed software to scrape data on SpaceX: Capsules, Rockets, Cores, Roadsters, SpaceX Info to use the software you need Python a

Maxence Rémy 16 Aug 02, 2022
A crawler of doubamovie

豆瓣电影 A crawler of doubamovie 一个小小的入门级scrapy框架的应用,选取豆瓣电影对排行榜前1000的电影数据进行爬取。 spider.py start_requests方法为scrapy的方法,我们对它进行重写。 def start_requests(self):

Cats without dried fish 1 Oct 05, 2021
A pure-python HTML screen-scraping library

Scrapely Scrapely is a library for extracting structured data from HTML pages. Given some example web pages and the data to be extracted, scrapely con

Scrapy project 1.8k Dec 31, 2022
京东茅台抢购最新优化版本,京东秒杀,添加误差时间调整,优化了茅台抢购进程队列

京东茅台抢购最新优化版本,京东秒杀,添加误差时间调整,优化了茅台抢购进程队列

776 Jul 28, 2021
Scrap-mtg-top-8 - A top 8 mtg scraper using python

Scrap-mtg-top-8 - A top 8 mtg scraper using python

1 Jan 24, 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
A simple python web scraper.

Dissec A simple python web scraper. It gets a website and its contents and parses them with the help of bs4. Installation To install the requirements,

11 May 06, 2022
Python script that reads Aliexpress offers urls from a Excel filename (.csv) and post then in a Telegram channel using a bot

Aliexpress to telegram post Python script that reads Aliexpress offers urls from a Excel filename (.csv) and post then in a Telegram channel using a b

Fernando 6 Dec 06, 2022
A simplistic scraper made to download tons of random screenshots made by people.

printStealer 1.1 What is this tool? This tool is developed to show the insecurity of the screenshot utility called prnt sc. It is a site that stores s

appelsiensam 4 Jul 26, 2022
An introduction to free, automated web scraping with GitHub’s powerful new Actions framework.

An introduction to free, automated web scraping with GitHub’s powerful new Actions framework Published at palewi.re/docs/first-github-scraper/ Contrib

Ben Welsh 15 Nov 24, 2022
ChromiumJniGenerator - Jni Generator module extracted from Chromium project

ChromiumJniGenerator - Jni Generator module extracted from Chromium project

allenxuan 4 Jun 12, 2022
Scraping web pages to get data

Scraping Data Get public data and save in database This is project use Python How to run a project 1 - Clone the repository 2 - Install beautifulsoup4

Soccer Project 2 Nov 01, 2021
Fundamentus scrapy

Fundamentus_scrapy Baixa informacões que os outros scrapys do fundamentus não realizam. Para iniciar (python main.py), sera criado um arquivo chamado

Guilherme Silva Uchoa 1 Oct 24, 2021
Crawler in Python 3.7, 3.8. 3.9. Pypy3

Description Python Crawler written Python 3. (Supports major Python releases Python3.6, Python3.7 and Python 3.8) Installation and Use Setup VirtualEn

Vinit Kumar 2 Mar 12, 2022
Web Scraping Framework

Grab Framework Documentation Installation $ pip install -U grab See details about installing Grab on different platforms here http://docs.grablib.

2.3k Jan 04, 2023
热搜榜-python爬虫+正则re+beautifulsoup+xpath

仓库简介 微博热搜榜, 参数wb 百度热搜榜, 参数bd 360热点榜, 参数360 csdn热榜接口, 下方查看 其他热搜待加入 如何使用? 注册vercel fork到你的仓库, 右上角 点击这里完成部署(一键部署) 请求参数 vercel配置好的地址+api?tit=+参数(仓库简介有参数信息

Harry 3 Jul 08, 2022
A Python Covid-19 cases tracker that scrapes data off the web and presents the number of Cases, Recovered Cases, and Deaths that occurred because of the pandemic.

A Python Covid-19 cases tracker that scrapes data off the web and presents the number of Cases, Recovered Cases, and Deaths that occurred because of the pandemic.

Alex Papadopoulos 1 Nov 13, 2021
Anonymously scrapes onlinesim.ru for new usable phone numbers.

phone-scraper Anonymously scrapes onlinesim.ru for new usable phone numbers. Usage Clone the repository $ git clone https://github.com/thomasgruebl/ph

16 Oct 08, 2022
Download images from forum threads

Forum Image Scraper Downloads images from forum threads Only works with forums which doesn't require a login to view and have an incremental paginatio

9 Nov 16, 2022