html parsing fail on empty documents
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start in extruct.utils at parse_xmldom_html and compare the linked parsel selector.py handling of empty documents and null bytes. No specific test is named; inspect the existing tests around these utilities and consider the work complete when the reported empty-document exception and the referenced null-byte case are handled consistently.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Exception like this can be raised by functions from extruct.utils:
document = parse_xmldom_html(html_string, encoding=encoding)
File "/usr/local/lib/python3.6/dist-packages/extruct/utils.py", line 16, in parse_xmldom_html
return lxml.html.fromstring(html, parser=parser)
File "/usr/local/lib/python3.6/dist-packages/lxml/html/__init__.py", line 876, in fromstring
doc = document_fromstring(html, parser=parser, base_url=base_url, **kw)
File "/usr/local/lib/python3.6/dist-packages/lxml/html/__init__.py", line 765, in document_fromstring
"Document is empty")
lxml.etree.ParserError: Document is empty
In parsel this is worked around: empty documents are handled explicitly. There is also an issue with null bytes handled. I think we should bring similar fixes to extruct. See https://github.com/scrapy/parsel/blob/e01093cf6342c90445028de28034b3cc3d2ead8b/parsel/selector.py#L38.
- Lingua principale
- Python
- Stelle
- 986
- Fork
- 127
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di scrapinghub/extruct
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
scrapinghub/extruct#278 · 1 reazione ·
-
Migrate to pytestForse già presa @Rotzbua l’ha presa 135 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
scrapinghub/extruct#252 ·
-
Tests fail with windowsForse già presa @Rotzbua l’ha presa 135 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
scrapinghub/extruct#251 ·
-
Install on modern pip and setuptools is failingForse già presa @Rotzbua l’ha presa 163 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
scrapinghub/extruct#241 · 5 commenti ·
-
Fix the Build Status badgeForse già presa @Rotzbua l’ha presa 163 giorni fa. Apertabug docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 56/100
scrapinghub/extruct#236 ·
Tutte le issue di scrapinghub/extruct
Issue simili
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount dueForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 79/100
developmentseed/titiler-covjson#164 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
awslabs/visual-asset-management-system#2164 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
MakazhanAlpamys/Soup#3589 ·
I maintainer di solito rispondono entro 1 giorno
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno