epub_to_audiobook icon indicating copy to clipboard operation
epub_to_audiobook copied to clipboard

Error when parsing book with nested chapters

Open GamerClassN7 opened this issue 11 months ago • 2 comments

I get error when trying to pase tis book: https://www.kosmas.cz/knihy/257693/ostre-stribro/

/usr/local/lib/python3.11/site-packages/bs4/builder/__init__.py:545: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument `features="xml"` into the BeautifulSoup constructor.
  warnings.warn(

Could it be connectet to nested chapters ? image

GamerClassN7 avatar Mar 20 '24 16:03 GamerClassN7

Hi @GamerClassN7. Looks like your error log is not completed for me.

I can only see the bellow log from your post which is normal warning from the underlying dependencies.

/usr/local/lib/python3.11/site-packages/bs4/builder/init.py:545: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument features="xml" into the BeautifulSoup constructor. warnings.warn(

p0n1 avatar Mar 21 '24 16:03 p0n1

Hi @GamerClassN7. Looks like your error log is not completed for me.

I can only see the bellow log from your post which is normal warning from the underlying dependencies.

/usr/local/lib/python3.11/site-packages/bs4/builder/init.py:545: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument features="xml" into the BeautifulSoup constructor. warnings.warn(

Sorry, for insufficient description @p0n1, in thee end it seems that problem is only half there since after converting the book all chapters are saved in incorrect order, ant that was the thing which mislead me that the XML parsing warning is root cause of the problem. I can buy a book for testing purposes to help you troubleshoot the issue

GamerClassN7 avatar Mar 25 '24 11:03 GamerClassN7