Small turning point uphill
In the previous post I said that there were difficulties in importing the data. Well, I added a small piece that has improved the situation considerably. There is an open source library called HTML Tidy, and just serves to "clean up" the ill-formed HTML code. It was originally written in C.
This library is used by a Python binding (ie a library that acts as "glue" between two languages, in this case C and Python) named μTidylib .
I tried it on my blog e. .. Well, the results are very good. I solved the problems I had when reading data. I tried with a handful of blogs selected at random, I can not say the same.
Tidy library to read and can not successfully convert the HTML code, and returns an empty file instead of the page cleaned up.
Unfortunately this time we are faced with a problem I had in a sense, feared, and that is that we were dealing with bad HTML format so heavy. What I do not is expected that the situation was so widespread. The only other blog that I could parse correctly is one that uses the same template that I use.
do not know who is to blame, if the browser is too permissive with regard to the most serious errors in the HTML pages rather than the little information with regard to issues such as W3C validation, the fact is that I am losing a lot of time to correct mistakes made by others, to ensure maximum compatibility.
I do not know which way to catch, if groped to give maximum compatibility correcting errors "downstream" or leave the burden to users to correct errors in the template.
In any case remains a last beach: change the template with a "minimal", that guarantees to eliminate up to its mistakes. If I turn
publish a small "gallery of horrors."
0 comments:
Post a Comment