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