Giter Club home page Giter Club logo

Comments (4)

petrstudynka avatar petrstudynka commented on August 30, 2024 3

For anyone who might with this struggle as I did, you need to add browserName, it won't process the args at all otherwise. Not sure if same applies for other browsers but my guess is, it does. I thought the driver can figure it on its own, but seems like it needs this "hint".

        let cap: Capabilities = serde_json::from_str(
            r#"{"browserName":"chrome","goog:chromeOptions":{"args":["--headless"]}}"#,
        )
        .unwrap();
        let driver = ClientBuilder::native()
            .capabilities(cap)
            .connect("http://127.0.0.1:4444")
            .await
            .expect("failed to connect to WebDriver");

Machine: x86 macOS Ventura 13.1 (22C65)
Driver: ChromeDriver 113.0.5672.63

from fantoccini.

jonhoo avatar jonhoo commented on August 30, 2024 2

I think I found the issue! Should be fixed shortly in a new minor release :)

from fantoccini.

anp avatar anp commented on August 30, 2024 1

Wonderful, tysm!

from fantoccini.

jonhoo avatar jonhoo commented on August 30, 2024

Glad to hear you've found it useful! I'd also love to hear about any documentation shortcomings you may have come across so that we can improve things going forward! Documenting the use of serde_json::json! for capabilities for example would be a great addition.

As for the issue at hand, that's pretty weird. What happens if you run chromedriver with --verbose? Looking at the Chrome docs, what you pass in should be sufficient. Looking at this SO question, some people seem to be passing headless without --, and while that doesn't immediately make sense to me, it could be that that's necessary for some reason?

from fantoccini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.