Skip to content

Instantly share code, notes, and snippets.

@turicas
Created March 26, 2019 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save turicas/ce666812311162b29f6f9e3ee73a5bc5 to your computer and use it in GitHub Desktop.
Save turicas/ce666812311162b29f6f9e3ee73a5bc5 to your computer and use it in GitHub Desktop.
Consulta site situacaocadastral.com.br
# pip install splinter
from splinter import Browser
def get_info(document):
browser = Browser("chrome")
browser.visit("https://www.situacaocadastral.com.br/")
input_doc = browser.find_by_xpath("//input[@id = 'doc']").first
input_doc.fill(document)
button_submit = browser.find_by_xpath("//input[@type = 'submit']").first
button_submit.click()
result = browser.find_by_xpath("//div[@id = 'resultado']").first
data = result.html
browser.quit()
return data # TODO: parse HTML
print(get_info("15102288000182")) # Odebrecht
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment