comparis has a strange dynamicaly loading js bullschit thing therefore the scrapper works but does not get all the data which is seen in the browser

This commit is contained in:
2024-07-02 14:00:19 +02:00
parent f629ff784f
commit a2a0001aef
3 changed files with 27 additions and 16 deletions

View File

@@ -10,7 +10,7 @@ var html: string
#var node: XmlNode
echo "URL:"
var url: string = "https://www.comparis.ch/immobilien/marktplatz/lenzburg/mieten"#readLine(stdin)
var url: string = "https://www.comparis.ch/immobilien/marktplatz/lenzburg/mieten?page=2"#readLine(stdin)
echo "given url is: ",url
try:
@@ -20,7 +20,7 @@ try:
var htmlnode: XmlNode
var entry : Entry
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 : "test", html_context_tag : "div",html_context_attrs : "class",html_context_key : "css-19re50j", html_tag : "p",aattrs : "class",attrs_key : "css-svet6u"))
#add(entry.desc,Descriptor(name:"key_and_string_search",contains_string: "a",html_context_tag : "div", html_tag : "a",attrs : "href"))
echo entry