Created
March 26, 2019 09:55
-
-
Save turicas/ce666812311162b29f6f9e3ee73a5bc5 to your computer and use it in GitHub Desktop.
Consulta site situacaocadastral.com.br
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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