This commit is contained in:
ccppi 2024-07-01 11:42:11 +02:00
parent 8eb7f4d49e
commit 4d2b868b76

View File

@ -10,7 +10,7 @@ type
html_context_tag* : string html_context_tag* : string
contains_string* : string contains_string* : string
attrs* : string attrs* : string
content* : string content* : seq[string]
type type
Entry* = object Entry* = object
desc* : seq[Descriptor] desc* : seq[Descriptor]
@ -31,16 +31,16 @@ proc getEntryFromHtml*(entry :var Entry, node : XmlNode) : Entry =
echo(" and string(innerText): ",content_txt) echo(" and string(innerText): ",content_txt)
if content_txt.contains(entry.desc[i].contains_string): if content_txt.contains(entry.desc[i].contains_string):
echo("PATTERN MATCH") echo("PATTERN MATCH")
entry.desc[i].content = content_txt entry.desc[i].content.add(content_txt)
else: else:
entry.desc[i].content = b.attrs[entry.desc[i].attrs] entry.desc[i].content.add(b.attrs[entry.desc[i].attrs])
elif entry.desc[i].contains_string != "": elif entry.desc[i].contains_string != "":
var content_txt = b.innerText() var content_txt = b.innerText()
echo(" string(innerText): ",content_txt) echo(" string(innerText): ",content_txt)
if content_txt.contains(entry.desc[i].contains_string): if content_txt.contains(entry.desc[i].contains_string):
echo("PATTERN MATCH") echo("PATTERN MATCH")
entry.desc[i].content = content_txt entry.desc[i].content.add(content_txt)
return entry return entry
proc test() = proc test() =