These are chat archives for rosshinkley/nightmare

28th
May 2016
bersam
@Bersam
May 28 2016 04:26
@rosshinkley yes, i need to post a form that not exist on that page but need session context of that page.
Amol
@amolc
May 28 2016 12:04
Hi Ross
/* jshint -W097 */
'use strict';
const Nightmare = require('nightmare');
const realMouse = require('nightmare-real-mouse');
realMouse(Nightmare);
var nightmare = Nightmare({ show: true });

nightmare
  .goto('http://www.housefly.com.sg/#bytop')
  .select('#ddlTOP', '2013')
  .click('#btnSearchByTOP')
  .wait('#sample_1')
  .evaluate(function(){ShowUnitFloorPlan('ODh5LzJJR0NXVW9pY3FJZ05MVlkzQT09',10172);})
  .wait(1000)
  .evaluate(function(){ShowFloorPlanInput('eHNNT3NFS1o3M1ByKzBMRmpNOTJaMnRXWHYwbXNPdHZhcWJMMHVkM2Q3bEFlOUZ1ZHFXL0dLUUJnRTJkOWhOKw==','18','WOODSVILLE CLOSE','14-02');})
  .type('form[action*="http://www.housefly.com.sg/default.aspx/ViewFloorPlan"] [name=address]', 'eHNNT3NFS1o3M1ByKzBMRmpNOTJaMnRXWHYwbXNPdHZhcWJMMHVkM2Q3bEFlOUZ1ZHFXL0dLUUJnRTJkOWhOKw==')
  .click('form[action*="http://www.housefly.com.sg/default.aspx/ViewFloorPlan"] [type=submit]')
  .html('./floorplan.html')
  .then(function (result) {console.log("done");})
  .catch(function (error) {console.error('Err:', error);});
I am able to push my code ahead, now the next issue is how I can try and get the HTML of a modal window which I open by evaluate, please do see the second evaluate function is working well, but I am unable to save the modal window.
Rick Medina
@rickmed
May 28 2016 18:13
@TimmyO18 et al...for the guys trying to run nightmare on heroku (coming late to the party...) don't try it...The problem is with chromium that needs a significant more allocation of dev/shm that heroku sets in their dynos (5mb on ALL of them, which is almost useless), and you can't change that bc heroku doesn't give you root access (was confirmed by support and I even tried a few hacks going the docker route...), so even if you make it work the the apt-get buildpacks, heroku-docker, etc, your scripts will crash within a few executed actions....
normally, linux distros allocate to dev/shm half of the available memory, so on a normal 512mb vm should work, like DO, vultr or whatever (I decided to go with the free AWS tier)
Amol
@amolc
May 28 2016 19:28
@rosshinkley my script worked .