Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the example code results in an error #198

Closed
haijd opened this issue Aug 5, 2024 · 1 comment
Closed

Running the example code results in an error #198

haijd opened this issue Aug 5, 2024 · 1 comment

Comments

@haijd
Copy link

haijd commented Aug 5, 2024

I used version 1.99.16 of spider-rs, with features "socks", "real_browser", "spoof", "headers", "fs", "chrome_stealth", "chrome_store_page", "chrome_screenshot" enabled.

ran the example code from the documentation:

use spider::tokio;
use spider::website::Website;

#[tokio::main]
async fn main() {
    let mut website: Website = Website::new("https://spider.cloud");

    website.crawl().await;

    let links = website.get_links();

    for link in links {
        println!("- {:?}", link.as_ref());
    }
}

The following error occurred:

error[E0061]: this function takes 2 arguments but 7 arguments were supplied
    --> /Users/hello/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spider-1.99.16/src/page.rs:335:29
     |
335  |         let page_resource = crate::utils::fetch_page_html(
     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
338  |             &page,
     |             ----- unexpected argument of type `&&chromiumoxide::Page`
339  |             wait_for,
     |             -------- unexpected argument of type `&std::option::Option<WaitFor>`
340  |             screenshot,
     |             ---------- unexpected argument of type `&std::option::Option<ScreenShotConfig>`
341  |             page_set,
     |             -------- unexpected argument of type `bool`
342  |             openai_config,
     |             ------------- unexpected argument of type `&std::option::Option<GPTConfigs>`
     |
note: function defined here
    --> /Users/hello/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spider-1.99.16/src/utils/mod.rs:1149:14
     |
1149 | pub async fn fetch_page_html(target_url: &str, client: &Client) -> PageResponse {
     |              ^^^^^^^^^^^^^^^ ----------------  ---------------
help: remove the extra arguments
     |
337  -             &client,
338  -             &page,
337  +             &client,
     |
@j-mendez
Copy link
Member

j-mendez commented Aug 5, 2024

fixed in 1.99.17 ty

@j-mendez j-mendez closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants