Skip to content

Ronald238/TucuJuris_Crawler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

TucuJuris Crawler

This Python code is a class called "ConsultaProcessual" that inherits from the class "Tucujuris". The "Tucujuris" class contains a method to perform HTTP requests ("request" method), a method to initialize and close sessions ("enter" and "exit" methods, respectively) and a "start" method that receives a field dictionary and returns data extracted from each HTTP request response. The "ConsultaProcessual" class defines two functions that perform the extraction of data from legal proceedings of Brazilian courts.

The "buscar_links" function is used to perform a GET request to a public API of the court specified in the "self.Tribunal" attribute. The function searches for process details based on a dictionary of fields provided by the user. Then the return of the GET request is parsed and the links for each process are extracted and stored in a list for later use.

The "extract_data" function is used to extract the relevant data for each process from the links retrieved in the "search_links" function. The function sends a GET request to the public API with the link to the process, extracts the relevant information (like header, involved parties, process movement, etc.) and returns a dictionary with that data.

Both functions call the "request" method to perform HTTP requests, which uses the Python "requests" library to send HTTP requests based on the provided arguments (method type, URL, parameters, data, headers, and timeout). The arguments for the "request" method are passed as parameters to the "search_links" and "extract_data" functions.

The code also imports other Python libraries (such as "os", "json", "logging" and "datetime") and a custom class called "Base". The code also uses the "init" and "exit" initialization methods and the "self" attributes to define and access variables internal to the class. The "ConsultaProcessual" class is used to access data from a specific judicial court in Brazil and extract information from court cases.

About

TucuJuris Web scraping

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages