Skip to content
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

Trafilatura cannot read gzipped pages? #781

Open
LaundroMat opened this issue Feb 2, 2025 · 1 comment
Open

Trafilatura cannot read gzipped pages? #781

LaundroMat opened this issue Feb 2, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@LaundroMat
Copy link
Contributor

When I'm trying to fetch and extract the Dramatiq.io homepage, Trafilatura cannot extract its contents.

>>> downloaded = fetch_url("https://dramatiq.io/")
>>> downloaded
(�/��X,P�Z��BD0g��������taP�-�������I��$���I"g��0ī����?�L�����������6�Aϫ�pP�����4�������0��mʖF���1�li	�x�����M����[�a���g�\�^�F�/�y�<ѿ���[�7zc��՝�+[��*c2דӡǩ�K�:fH���8�i��Q...)

>>> extract(downloaded, output_format="markdown", include_comments=False, with_metadata=False) is None
True

How can I fix this?

@LaundroMat
Copy link
Contributor Author

Fixed it by using httpx.get to get the document instead of fetch_url.

@LaundroMat LaundroMat changed the title Trafilatura cannot read zstd encoded pages? Trafilatura cannot read gzipped pages? Feb 3, 2025
@adbar adbar added the bug Something isn't working label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants