spider-rs / spider

A web crawler and scraper for Rust
https://spider.cloud
MIT License
1.16k stars 100 forks source link

Retrieve response cookies #202

Closed viktorholk closed 3 months ago

viktorholk commented 3 months ago

It seems that enabling the feature: cookies only allows to configure the request cookies with the cookie_str field in the Configuration struct.

Like the headers feature to get the response headers i would also like to get the response cookies.

I expect that it is possible through the chromiumoxide::Page struct but it is a private field in the Page

pub struct Page {
    ....
    #[cfg(feature = "chrome")]
    /// Page object for chrome. The page may be closed when accessing it on another thread from concurrency.
    chrome_page: Option<chromiumoxide::Page>,
    ....
}

get_cookies method

Thanks!

j-mendez commented 3 months ago

v2.0.2 you can use get_chrome_page to get access to chrome_page now.