python-satcfdi icon indicating copy to clipboard operation
python-satcfdi copied to clipboard

Login no sire

Open AgoraSecurity opened this issue 11 months ago • 1 comments

Describe the bug Error con sat_session.login()

To Reproduce Steps to reproduce the behavior:

  1. Ejecuta el código de: https://satcfdi.readthedocs.io/en/stable/pages/getting_started/52_portal_facturacion.html

Error:

Traceback (most recent call last):
  File "/Users/manuel/src/facturassat/validacion.py", line 12, in <module>
    sat_session.login()
    ~~~~~~~~~~~~~~~~~^^
  File "/Users/manuel/src/facturassat/.venv/lib/python3.13/site-packages/satcfdi/portal/__init__.py", line 135, in login
    self._request_verification_token = request_verification_token(res)
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/Users/manuel/src/facturassat/.venv/lib/python3.13/site-packages/satcfdi/portal/utils.py", line 83, in request_verification_token
    return html.find(name='input', attrs={'name': '__RequestVerificationToken'}).attrs['value']
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'attrs'

Nota: Creo que fue por el cambio de la página del SAT.

Al hacer

Python 3.13.1 (main, Jan 14 2025, 23:31:50) [Clang 19.1.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> res.text
'<!doctype html>\r\n<html lang="en">\r\n<head>\r\n    <meta charset="utf-8">\r\n    <meta name="description" content="">\r\n    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">\r\n    <meta http-equiv="X-UA-Compatible" content="IE=edge" />\r\n    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">\r\n    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">\r\n    <title>Factura</title>\r\n\r\n    <script type=\'text/javascript\' nonce="app

Veo HTLM válido

AgoraSecurity avatar Mar 06 '25 01:03 AgoraSecurity

probablemente sea por los cambios en el portal del sat

satcfdi avatar Mar 06 '25 16:03 satcfdi

Cerrando Issues Inactivos

satcfdi avatar Jun 23 '25 20:06 satcfdi