Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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.
    I tried to add electron-pdf-window in electron, but i get the session error to
    Now, I'm searching to enable support for non-electronic plugins to see if it works. Because the pdf is available for viewing.
    Davide De Gennaro
    @dege88
    @tpsvr_twitter this plugin should do what you need: https://github.com/rosshinkley/nightmare-download-manager
    Tiago
    @tpsvr_twitter
    I tried this and nightmare-inline-download, but neither of them supressed the dialog asking for the file name to save and downloaded.
    Davide De Gennaro
    @dege88
    @tpsvr_twitter have you tried with the suggestion of https://stackoverflow.com/questions/27109563/download-a-file-using-nightmare ?
    also, have you tried to execute nightmare without the graphic debug active?
    Tiago
    @tpsvr_twitter
    @dege88 These examples I tried but did not work.
    With show: false I tried it now and it did not work.
    thanks
    Basheer
    @basherr
    any one there?'
    Anouar Hassine
    @anouarhassine
    Hi everyone, am using CodeceptJs with Nightmare for my end to end test. Is there a way to set the browser language? Because my app is detecting the browser language with navigator.language and I'd like to test using a specific one. Thanks!
    Davide De Gennaro
    @dege88
    @anouarhassine use the .header function to pass an accept language header with your language
    (you can sniff your browsers headers with this site: https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending or by using the inspector of your browser)
    Anouar Hassine
    @anouarhassine
    Thanks @dege88 I'll have a look at that!
    Basheer
    @basherr
    segmentio/nightmare#1357
    I see that the issues aren't being resolved. Do you guys have any plan to maintain?
    Davide De Gennaro
    @dege88
    @basherr after the release of headless chrome ( https://developers.google.com/web/updates/2017/04/headless-chrome ) almost all the browser automation libraries died
    @basherr about your issue I believe that the class definition is not visible inside the execute scope, I believe that you need to redeclare it inside.
    Basheer
    @basherr
    @dege88 There isn't just that much code but alot...! It was just for hint...
    Davide De Gennaro
    @dege88
    @basherr I expected it, but unfortunately (fortunately) the electron process and the node process don't share the same resources
    yorick
    @ctrlaltdev
    Hi, I've submitted this PR: segmentio/nightmare#1364 - it really just update the electron version to fix a vulnerability.
    doriansavage
    @doriansavage
    Hi
    I have an application that needs to scrape differents websites from a list of search terms. Exemple, I put 5 search terms (1 by line on a textarea). And for each search term, I want to type it on : amazon, site2, site3 and site4. And then take a screenshots. It works, but I have lots of difficulty about performences...
    How would you do ?
    doriansavage
    @doriansavage
    I would like smth like that
    but I could have hundreds of search terms
    si I guess I have to wait until each website is scraped to use the next nightmare goto
    could someone help me ? I have budget
    Sayam Qazi
    @devqazi
    Hi
    doriansavage
    @doriansavage
    Hi someone is here ?