msva / lua-htmlparser

An HTML parser for lua.
231 stars 44 forks source link

body is appearing as child of head in .nodes #60

Closed UnChiller closed 2 years ago

UnChiller commented 2 years ago

Screenshot 2022-04-02 200904 Html file my code (before screenshot)

htmlparser = require("htmlparser")
file = fs.open("index.html")
root = htmlparser.parse(file.readAll())

Lua version: 5.1 (I feel I might be doing something wrong)

msva commented 2 years ago

please, add following code to your script (before calling parse):

htmlparser_opts = {
  debug = true
}

and call parser again. And upload the log (it will be very huge, so you can prefer to redirect output to file)

msva commented 2 years ago

Although, nevermind, I found the bug myself :)