Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Davide De Gennaro
    @dege88
    @AshCoolman I also got problems with clicking in react apps, try executing your code in your browser (faster debug) and try to use various ways to invoke the click event (I can't remember exactly which one I used)
    jokyme
    @jokyme
    hi
    can i run nightmare as a webview inside electron?
    jokyme
    @jokyme
    anybody here?
    jokyme
    @jokyme
    大家好
    doriansavage
    @doriansavage
    hi
    someone here ?
    after npm install I got Cannot find module "nightmare"
    running "node example.js"
    Davide De Gennaro
    @dege88
    did you use the command npm install nightmare?
    doriansavage
    @doriansavage
    yes I did
    its ok now after -g
    but when I run the script nothin happen
    image.png
    image.png
    doriansavage
    @doriansavage
    I was expecting see "Don!" or errors...
    Davide De Gennaro
    @dege88
    @doriansavage did you init your module?
    npm init
    Also try starting with a known example like: https://github.com/segmentio/nightmare/blob/master/example.js
    doriansavage
    @doriansavage
    I tried but same
    I just created a fresh debian server on digitalOcean
    @dege88 :)
    ls
    oups
    new folder
    npm init
    npm install nightmare
    nano example.js
    node example.js
    => no outputs... :sa:
    doriansavage
    @doriansavage
    :(
    jokyme
    @jokyme
    :worried:
    Davide De Gennaro
    @dege88
    @doriansavage which OS are you using?
    doriansavage
    @doriansavage
    its solved
    smth regarding HEADLESS etc
    it was vps Debian
    Davide De Gennaro
    @dege88
    great
    doriansavage
    @doriansavage
    nightmare is working but I get also this ...
    sh: 0: getcwd() failed: No such file or directory
    any ideas ?
    doriansavage
    @doriansavage

    no because I'm just runing "node example.js"
    in the .then callback I console.log('scrapping success');
    and my console output is :

    scrapping success
    sh: 0: getcwd() failed: No such file or directory

    don't even know from where this sh command comes from
    Nastia Pavliuk
    @NastiaPavliuk
    Hi there. I need help. I try to add my extension to electron, but it's doesn't work
    ` var Nightmare = require('nightmare');
    var args = {
    openDevTools: {
    mode: 'detach'
    },
    show: true,
    alwaysOnTop: true,
    electronPath: require('../node_modules/electron')
    };
    var nightmare = Nightmare(args);
    var addLinkMatch = function () {
        return function(Nightmare) {
            console.log("some")
            Nightmare.action('addLinkMatch', (name, options, parent, win, renderer, done) => {
                    console.log("extension start adding")
                    parent.respondTo('addLinkMatch', (done) => {
                        console.log("extension will be added")
                        win.addDevToolsExtension('..//dist').addLinkMatch(done);
                        console.log("extension was added")
                    });
                    done();
                },
                function (done) {
                    this.child.call('addLinkMatch', done);
                });
    
        }
    }
    document.getElementById("start").addEventListener("click", function(){
        document.getElementById("status").innerHTML = "Searching for the gem";
    
        nightmare
            .goto('http://yahoo.com')
            .type('form[action*="/search"] [name=p]', 'github')
            .click('form[action*="/search"] [type=submit]')
            .wait('#main')
            .use(addLinkMatch())
    
            .evaluate(function () {
                win.addDevToolsExtension()
            })
            .evaluate(function () {
                console.log(document.querySelector('#main .searchCenterMiddle li a').href)
                return document.querySelector('#main .searchCenterMiddle li a').href
            })
            .then(function (result) {
                document.getElementById("results").innerHTML = result;
            })
            .catch(function (error) {
                document.getElementById("results"). innerHtml = "Search failed: " + error;
            });
    
    })
    document.getElementById("stop").addEventListener("click", function(){
        nightmare
            .end()
            .then(function (result) {
                document.getElementById("status").innerHTML = "Leaving Nightmare Speechless";
            })
    })  `
    Jay Landro
    @jaylandro

    Hi gitter, I really love nightmare and am utilizing it inside containers for PDF generation, automated testing and consumer based testing. I do have one thing that is a little unclear in the docs to me.

    Supposedly we can set up a listener for console events like this:

    .on('console', function(type [, arguments, ...]))

    These events are not firing for me, is there a reliable way you all are using to capture console events, most importantly if a console.error is thrown?

    Thanks!

    Tiago
    @tpsvr_twitter
    hI!
    Please..
    How can I get a image from img tag without using screenshot() ?
    Davide De Gennaro
    @dege88
    @tpsvr_twitter you can get the src attribute and download the file directly
    Tiago
    @tpsvr_twitter
    Hello again! Please...
    How to create pdf of a specific element?
    Ignoring the rest of the page?
    Davide De Gennaro
    @dege88
    i would get the element and delete everything else on the page
    before printing @tpsvr_twitter
    Tiago
    @tpsvr_twitter

    Hi!
    It is no longer possible to pass a function as a parameter?

    var myfn = function(p) { ... };
    nightmare
      .goto(myUrl)
      .evaluate((p,fn)=>{ fn(p); }, p, myfn)
      .then( ... )

    I'm getting the error: myfn is not a function

    Tiago
    @tpsvr_twitter
    Hei!
    Please, I have one last problem.
    The PDF that I need to download is being opened in another window that prompts me to tell where to save.
    How can I automate this?
    Davide De Gennaro
    @dege88
    @tpsvr_twitter can you get the url of the file to download directly?
    Tiago
    @tpsvr_twitter
    @dege88 , no! The link ends with GetPDF.aspx and if I try to open the same link in another window I already get a session error.