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

encoding errors #153

Open
tmbdev opened this issue Aug 13, 2019 · 1 comment
Open

encoding errors #153

tmbdev opened this issue Aug 13, 2019 · 1 comment

Comments

@tmbdev
Copy link
Collaborator

tmbdev commented Aug 13, 2019

Many HTML files do not contain proper character set declarations, but we still need to be able to read them. LXML is a bit too picky and fails when such files are opened with:

doc = html.parse(args.file)

See the discussion here for how to fix it:

https://stackoverflow.com/questions/15302125/html-encoding-and-lxml-parsing

I'm going to see whether I can add a fix for this.

@zuphilip
Copy link
Collaborator

How do your example files look like? Can you share one here (or at least the beginning of it)?

All examples in the linked discussion seem to have a proper character set declaration, but lxml does not recognize the short form <meta charset='utf-8'>. Do you face the same problem?

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