Skip to content

Login no sire #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AgoraSecurity opened this issue Mar 6, 2025 · 1 comment
Open

Login no sire #38

AgoraSecurity opened this issue Mar 6, 2025 · 1 comment

Comments

@AgoraSecurity
Copy link

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

@satcfdi
Copy link
Member

satcfdi commented Mar 6, 2025

probablemente sea por los cambios en el portal del sat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants