Skip to content

Instantly share code, notes, and snippets.

@necenzurat
Created April 19, 2016 12:58
Show Gist options
  • Select an option

  • Save necenzurat/d4e9ee793d37e0c9165923493cd92b22 to your computer and use it in GitHub Desktop.

Select an option

Save necenzurat/d4e9ee793d37e0c9165923493cd92b22 to your computer and use it in GitHub Desktop.

Revisions

  1. necenzurat created this gist Apr 19, 2016.
    23 changes: 23 additions & 0 deletions scraper.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    var page = require('webpage').create();

    page.onConsoleMessage = function(msg) {
    console.log(msg);
    };


    page.open("http://www.dauanunt.ro/cont/login", function(status) {
    if ( status === "success" ) {
    page.evaluate(function() {
    document.querySelector("input[name='u']").value = "gabrielaromania66@gmail.com";
    document.querySelector("input[name='p']").value = "testing";
    document.querySelector("input[type='submit']").click();

    console.log("Login submitted!");
    });
    window.setTimeout(function () {
    page.render('fucking-hell-we-are-in.png');
    phantom.exit();
    }, 5000);
    }

    });