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
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.

Josué Campos 5 Nov 29, 2021
Raspi-scraper is a configurable python webscraper that checks raspberry pi stocks from verified sellers

Raspi-scraper is a configurable python webscraper that checks raspberry pi stocks from verified sellers.

Louie Cai 13 Oct 15, 2022
Lovely Scrapper

Lovely Scrapper

Tushar Gadhe 2 Jan 01, 2022
A list of Python Bots used to extract data from several websites

A list of Python Bots used to extract data from several websites. Data extraction is for products on e-commerce (ecommerce) websites. Data fetched i

Sahil Ladhani 1 Jan 14, 2022
A distributed crawler for weibo, building with celery and requests.

A distributed crawler for weibo, building with celery and requests.

SpiderClub 4.8k Jan 03, 2023
Pelican plugin that adds site search capability

Search: A Plugin for Pelican This plugin generates an index for searching content on a Pelican-powered site. Why would you want this? Static sites are

22 Nov 21, 2022
爬虫案例合集。包括但不限于《淘宝、京东、天猫、豆瓣、抖音、快手、微博、微信、阿里、头条、pdd、优酷、爱奇艺、携程、12306、58、搜狐、百度指数、维普万方、Zlibraty、Oalib、小说、招标网、采购网、小红书》

lxSpider 爬虫案例合集。包括但不限于《淘宝、京东、天猫、豆瓣、抖音、快手、微博、微信、阿里、头条、pdd、优酷、爱奇艺、携程、12306、58、搜狐、百度指数、维普万方、Zlibraty、Oalib、小说网站、招标采购网》 简介: 时光荏苒,记不清写了多少案例了。

lx 793 Jan 05, 2023
A Python web scraper to scrape latest posts from official Coinbase's Blog.

Coinbase Blog Scraper A Python web scraper to scrape latest posts from official Coinbase's Blog. IDEA It scrapes up latest blog posts from https://blo

Lucas Villela 3 Feb 18, 2022
jd_maotai rpa 基于selenium驱动的jd抢购rpa机器人

jd_maotai rpa 基于selenium驱动的jd抢购rpa机器人, 照顾我们这样的马大哈, 不会忘记抢购了, 祝大家过年都能喝上茅台. 特别声明: 本仓库发布的jd_maotai_rpa项目定义为自动化rpa项目, 是用于防止忘记参与jd茅台的活动(由于本人时常忘记), 而不是为了秒杀和抢

35 Nov 18, 2022
This tool can be used to extract information from any website

WEB-INFO- This tool can be used to extract information from any website Install Termux and run the command --- $ apt-get update $ apt-get upgrade $ pk

1 Oct 24, 2021
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
Python framework to scrape Pastebin pastes and analyze them

pastepwn - Paste-Scraping Python Framework Pastebin is a very helpful tool to store or rather share ascii encoded data online. In the world of OSINT,

Rico 105 Dec 29, 2022
WebScrapping Project - G1 Latest News

Web Scrapping com Python Esse projeto consiste em um código para o usuário buscar as últimas nóticias sobre um termo qualquer, no site G1. Para esse p

Eduardo Henrique 2 Feb 13, 2022
Twitter Eye is a Twitter Information Gathering Tool With Twitter Eye

Twitter Eye is a Twitter Information Gathering Tool With Twitter Eye, you can search with various keywords and usernames on Twitter.

Jolanda de Koff 19 Dec 12, 2022
Semplice scraper realizzato in Python tramite la libreria BeautifulSoup

Semplice scraper realizzato in Python tramite la libreria BeautifulSoup

2 Nov 22, 2021
Get paper names from dblp.org

scraper-dblp Get paper names from dblp.org and store them in a .txt file Useful for a related literature :) Install libraries pip3 install -r requirem

Daisy Lab 1 Dec 07, 2021
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
🥫 The simple, fast, and modern web scraping library

About gazpacho is a simple, fast, and modern web scraping library. The library is stable, actively maintained, and installed with zero dependencies. I

Max Humber 692 Dec 22, 2022
Scraping followers of an instagram account

ScrapInsta A script to scraping data from Instagram Install First of all you can run: pip install scrapinsta After that you need to install these requ

Matheus Kolln 1 Sep 05, 2021
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