python-satcfdi
python-satcfdi copied to clipboard
Login no sire
Describe the bug
Error con sat_session.login()
To Reproduce Steps to reproduce the behavior:
- 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
probablemente sea por los cambios en el portal del sat
Cerrando Issues Inactivos