fix bug where not checking for attrs != nil

This commit is contained in:
2024-07-02 12:11:24 +02:00
parent 605480dbfd
commit f629ff784f
3 changed files with 26 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ var html: string
#var node: XmlNode
echo "URL:"
var url: string = readLine(stdin)
var url: string = "https://www.comparis.ch/immobilien/marktplatz/lenzburg/mieten"#readLine(stdin)
echo "given url is: ",url
try:
@@ -20,7 +20,7 @@ try:
var htmlnode: XmlNode
var entry : Entry
add(entry.desc,Descriptor(name : "", html_context_tag : "div",html_context_attrs : "class",html_context_key : "css-1d60yla ehesakb4", html_tag : "a",attrs : "href"))
add(entry.desc,Descriptor(name : "test", html_context_tag : "div",html_context_attrs : "class",html_context_key : "css-1wvv8q", html_tag : "a",aattrs : "href"))
#add(entry.desc,Descriptor(name:"key_and_string_search",contains_string: "a",html_context_tag : "div", html_tag : "a",attrs : "href"))
echo entry