Skip to content

Console application that uses WebScrapping techniques to find a free appointment in Brazilian Passaport schedule.

License

Notifications You must be signed in to change notification settings

rafaporci/BrazillianPassportFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is BrazillianPassportFinder?

It's a quite simple console application that check if there is some free appointment in Brazilian passaport portal. A protocol to passaport requirement should be open in the portal (https://servicos.dpf.gov.br/sinpa/inicializacaoSolicitacao.do?dispatch=inicializarSolicitacaoPassaporte) before to run the program. It also send a report by email with the cities checked and if it found some free slot. The program uses popular techniques of web scrapping to retrieve data from the HTMLs fetched from the portal. It also uses HttpClient to interact with the portal server, retriving data like a browser does.

Before to run the program

You need to fill-up some placeholders with your data before to run the code in the Program.cs class:

  • Email list to be notified;
  • CPF of the person trying to find a slot;
  • Protocol number generated by the portal;
  • Birth data of the person trying to find a slot;
  • UF to restricted the search to a specific brazillian state;

If you wish to send to report by email, please complete the EmailNotifier class with your SMTP server data.

Tests

In order to ensure that all critical components are working properly with the responses from the portal, a set of unit tests cover some common scenarios and corner cases. The tests use FluentAssertions to simplify our assertions and Moq to mock resposes from the portal.

Retrieving data

In order to analyze and get data from HTMLs, the program use HtmlAgilityPack, a very nice tool to web scrapping.

Dependency from Brazilian Passport Portal version

Like all web scraping solution, this program was developed to retrieve data from a specific version of the portal. If some major change occur there, the program should be changed too.

Usage

This project was created for educational matters to exemplify how to retrieve data from complex portals, if you have some doubt, please feel free to reach me.

About

Console application that uses WebScrapping techniques to find a free appointment in Brazilian Passaport schedule.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published