Consulta de CPF e CNPJ na Receita Federal com Web-Scraping

Overview

Consulta de CPF e CNPJ na Receita Federal com Web-Scraping

Repositório contendo scripts Python que realizam a consulta de CPF e CNPJ diretamente no site da Receita Federal.

Requerimentos

  • Python 3.x instalado;
  • Driver do navegador que será utilizado. Clique aqui para mais informações;
  • Caminho do driver baixado adicionado ao PATH.

Instalação

Na pasta do repositório, execute o comando:

pip install -r requirements.txt

Alterações necessárias

Para a execução, é necessário adaptar o código para o navegador que será utilizado. Por padrão o código utiliza o navegador Microsoft Edge. Modificar se necessário:

  • Importações dos módulos. Mudar edge para o navegador que será usado:
from selenium.webdriver.edge.service import Service
from selenium.webdriver.edge.options import Options
  • Caminho do driver baixado:
PATH_TO_DRIVER = "C:/edge_driver/msedgedriver.exe"
  • Inicialização do webdriver. Mudar Edge para o navegador que será usado:
driver = webdriver.Edge(service=serv, service_log_path="NUL", options=options)

Consulta de CNPJ - Exemplo

Na pasta do repositório, execute o comando:

python cnpj/consulta_cnpj.py

Digite os campos necessários:

Digite o CNPJ (somente números): 06990590000395
Digite os caracteres da imagem exibida: ZaQO5z

Com os dados inseridos corretamente, a consulta exibirá um JSON de retorno:

{
    "cnpj": "06.990.590/0003-95",
    "tipo_empresa": "FILIAL",
    "data_abertura": "11/01/2008",
    "nome_empresarial": "GOOGLE BRASIL INTERNET LTDA.",
    "nome_fantasia": "********",
    "endereco": {
        "logradouro": "AV DOS ANDRADAS",
        "numero": "3000",
        "complemento": "ANDAR 5 14 15 16 17 EDIF BOULEVARD CORPORATE",
        "cep": "30.260-070",
        "bairro": "SANTA EFIGENIA",
        "municipio": "BELO HORIZONTE",
        "estado": "MG"
    },
    "email": "[email protected]",
    "telefone": "(11) 2395-8400",
    "situacao_cadastral": "ATIVA",
    "data_situacao_cadastral": "11/01/2008"
}

Consulta de CPF - Exemplo

Na pasta do repositório, execute o comando:

python cpf/consulta_cpf.py

Digite os campos necessários:

Digite o CPF (somente números): 12345678901
Digite a data de nascimento (DD/MM/AAAA): 25/12/2000
Digite os caracteres da imagem exibida: 9XETCm

Com os dados inseridos corretamente, a consulta exibirá um JSON de retorno:

{
    "cpf": "123.456.789-01",
    "nome": "FULANO BELTRANO CICLANO",
    "data_nascimento": "25/12/2000",
    "situacao_cadastral": "REGULAR",
    "data_inscricao": "12/04/2006",
    "digito_verificador": "00"
}
Owner
Josué Campos
I am a student of computer science at @ufv. Computer mathematics, AI, data science and IoT enthusiastic.
Josué Campos
Library to scrape and clean web pages to create massive datasets.

lazynlp A straightforward library that allows you to crawl, clean up, and deduplicate webpages to create massive monolingual datasets. Using this libr

Chip Huyen 2.1k Jan 06, 2023
Web-Scrapper using Python and Flask

Web-Scrapper "[초급]Python으로 웹 스크래퍼 만들기" 코스 -NomadCoders 기초적인 Python 문법강의부터 시작하여 웹사이트의 html파일에서 원하는 내용을 Scrapping해서 출력, csv 파일로 저장, flask를 이용한 간단한 웹페이지

윤성도 1 Nov 10, 2021
Python scrapper scrapping torrent website and download new movies Automatically.

torrent-scrapper Python scrapper scrapping torrent website and download new movies Automatically. If you like it Put a ⭐ on this repo 😇 Run this git

Fazil vk 1 Jan 08, 2022
A scalable frontier for web crawlers

Frontera Overview Frontera is a web crawling framework consisting of crawl frontier, and distribution/scaling primitives, allowing to build a large sc

Scrapinghub 1.2k Jan 02, 2023
a Scrapy spider that utilizes Postgres as a DB, Squid as a proxy server, Redis for de-duplication and Splash to render JavaScript. All in a microservices architecture utilizing Docker and Docker Compose

This is George's Scraping Project To get started cd into the theZoo file and run: chmod +x script.sh then: ./script.sh This will spin up a Postgres co

George Reyes 7 Nov 27, 2022
👁️ Tool for Data Extraction and Web Requests.

httpmapper 👁️ Project • Technologies • Installation • How it works • License Project 🚧 For educational purposes. This is a project that I developed,

15 Dec 05, 2021
抢京东茅台脚本,定时自动触发,自动预约,自动停止

jd_maotai 抢京东茅台脚本,定时自动触发,自动预约,自动停止 小白信用 99.6,暂时还没抢到过,朋友 80 多抢到了一瓶,所以我感觉是跟信用分没啥关系,完全是看运气的。

Aruelius.L 117 Dec 22, 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
Tool to scan for secret files on HTTP servers

snallygaster Finds file leaks and other security problems on HTTP servers. what? snallygaster is a tool that looks for files accessible on web servers

Hanno Böck 2k Dec 28, 2022
script to scrape direct download links (ddls) from google drive index.

bhadoo Google Personal/Shared Drive Index scraper. A small script to scrape direct download links (ddls) of downloadable files from bhadoo google driv

sαɴᴊɪᴛ sɪɴʜα 53 Dec 16, 2022
Google Developer Profile Badge Scraper

Google Developer Profile Badge Scraper GDev Profile Badge Scraper is a Google Developer Profile Web Scraper which scrapes for specific badges in a use

Siddhant Lad 7 Jan 10, 2022
Audio media crawler for lbry.

Audio media crawler for lbry. Requirements Python 3.8 Poetry 1.1.7 Elasticsearch 7.14.0 Lbry-sdk 0.99.0 Development This project uses poetry as a depe

Hound.fm 4 Dec 03, 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
A training task for web scraping using python multithreading and a real-time-updated list of available proxy servers.

Parallel web scraping The project is a training task for web scraping using python multithreading and a real-time-updated list of available proxy serv

Kushal Shingote 1 Feb 10, 2022
Crawl the information of a given keyword on Google search engine

Crawl the information of a given keyword on Google search engine

4 Nov 09, 2022
薅薅乐 - JD 测试脚本

薅薅乐 安裝 使用docker docker一键安装: docker run -d --name jd classmatelin/hhl:latest. 使用 进入容器: docker exec -it jd bash 获取JD_COOKIES: python get_jd_cookies.py,

ClassmateLin 575 Dec 28, 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
A Python module to bypass Cloudflare's anti-bot page.

cloudflare-scrape A simple Python module to bypass Cloudflare's anti-bot page (also known as "I'm Under Attack Mode", or IUAM), implemented with Reque

3k Jan 04, 2023
Displays market info for the LUNI token on the Terra Blockchain

LuniBot for Discord Displays market info for the LUNI/LUNA token on the Terra Blockchain (Webscrape method currently scraping CoinMarketCap). Will evo

0 Jan 22, 2022
Here I provide the source code for doing web scraping using the python library, it is Selenium.

Here I provide the source code for doing web scraping using the python library, it is Selenium.

M Khaidar 1 Nov 13, 2021