Open PR0J3CT12 opened 11 months ago
Can you add more information, please?
1) how did you installed package? 2) how do you use it (interactively, or in script) 3) can you post full stacktrace, please?
Mb im doing something wrong, but im trying to use library in nse(nmap scripting engine). Im not sure, that i can use libraries like in pure lua.
/usr/local/share/lua/5.3/htmlparser.lua:14: variable 'htmlparser_opts' is not declared
stack traceback:
[C]: in function 'error'
/usr/bin/../share/nmap/nselib/strict.lua:80: in metamethod '__index'
/usr/local/share/lua/5.3/htmlparser.lua:14: in main chunk
[C]: in function 'require'
/usr/bin/../share/nmap/scripts/http-ssrf.nse:14: in function </usr/bin/../share/nmap/scripts/http-ssrf.nse:1>
UPD:
lib "gumbo" is working with nse, as i can see, idk why)
![Снимок](https://github.com/msva/lua-htmlparser/assets/45341405/c8d89f2d-54ef-4377-8311-83e0ba19367e)
It seems, this engine redefines the metatables, and this causes a problem (originally the line it points to calls a function that checks if htmlparser_opts
is a table, and it being nil
is originally acceptable option (it just won't return anything).
Also, I just tested on clean lua5.3 and there is no such error. So it is definitelly the engine's who is guilty.
As a workaround I suggest you to just define htmlparser_opts
(global) variable as ampty table (or not empty, if you want to modify some settings) before require"htmlparser"
.
Im getting error "variable 'htmlparser_opts' is not declared" after local htmlparser = require ("htmlparser"). How can i fix it?