(self, cep)
| 24 | logging.config.dictConfig(config) |
| 25 | |
| 26 | def _request(self, cep): |
| 27 | response = requests.post(self.url, data={ |
| 28 | 'cepEntrada': cep, |
| 29 | 'tipoCep': '', |
| 30 | 'cepTemp': '', |
| 31 | 'metodo': 'buscarCep' |
| 32 | }) |
| 33 | try: |
| 34 | response.raise_for_status() |
| 35 | except requests.exceptions.HTTPError as ex: |
| 36 | logging.error('Erro request site Correios', exc_info=True) |
| 37 | raise ex |
| 38 | return response.text |
| 39 | |
| 40 | def _get_infos_(self, cep): |
| 41 | from lxml.html import fromstring |