skrapeit / skrape.it

A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.
https://docs.skrape.it
MIT License
813 stars 59 forks source link

[QUESTION] How to disable log in the console #191

Open truongnmt opened 2 years ago

truongnmt commented 2 years ago

describe what you want to archive I'm crawling a website and I got some error log in the console:

W 18:45:05.272 [rotocol.ResponseProcessCookies] Cookie rejected [ali_apache_id="33.22.117.208.165684150532.144344.8", version:0, domain:.aliexpress.com, path:/, expiry:Thu Nov 30 10:01:01 JST 2084] Illegal 'domain' attribute ".aliexpress.com". Domain of origin: "login.aliexpress.ru"
W 18:45:05.274 [rotocol.ResponseProcessCookies] Cookie rejected [ali_apache_track="", version:0, domain:.alibaba.com, path:/, expiry:Fri Jul 21 21:59:12 JST 2090] Illegal 'domain' attribute ".alibaba.com". Domain of origin: "login.aliexpress.ru"
W 18:45:05.274 [rotocol.ResponseProcessCookies] Cookie rejected [ali_apache_tracktmp="", version:0, domain:.alibaba.com, path:/, expiry:null] Illegal 'domain' attribute ".alibaba.com". Domain of origin: "login.aliexpress.ru"
W 18:45:05.802 [rotocol.ResponseProcessCookies] Cookie rejected [ali_apache_id="33.22.117.204.1656841505733.633244.5", version:0, domain:.aliexpress.com, path:/, expiry:Thu Nov 30 10:01:01 JST 2084] Illegal 'domain' attribute ".aliexpress.com". Domain of origin: "login.tmall.ru"
W 18:45:05.804 [rotocol.ResponseProcessCookies] Cookie rejected [ali_apache_track="", version:0, domain:.alibaba.com, path:/, expiry:Fri Jul 21 21:59:12 JST 2090] Illegal 'domain' attribute ".alibaba.com". Domain of origin: "login.tmall.ru"
W 18:45:05.804 [rotocol.ResponseProcessCookies] Cookie rejected [ali_apache_tracktmp="", version:0, domain:.alibaba.com, path:/, expiry:null] Illegal 'domain' attribute ".alibaba.com". Domain of origin: "login.tmall.ru"

I would like to ask how can I disable these logs? Thank you!

Code Sample

skrape(BrowserFetcher) {
    request {
        url = url
        userAgent =
            "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
        sslRelaxed = true
        timeout = 10000
    }
    response {
        priceRange = htmlDocument {
            span(".a-special-class") {
                findFirst {
                    text
                }
            }
        }
    }
}