gulp-phantomcss icon indicating copy to clipboard operation
gulp-phantomcss copied to clipboard

Localhost URL isn't finding the selector

Open shanejeffers opened this issue 9 years ago • 2 comments

If I pass in a remote URL like google.com this works, but if I pass in a local URL like (https://test.dev) it can't ever find the selector. Is there a way I can troubleshoot this? Or is there a different URL I should be using when doing localhost testing?

Gulp task:

gulp.task('test', function (){
  gulp.src('./testsuite.js')
    .pipe($.phantomcss());
});

testsuite.js :

casper.
  start('https://site.dev').
  then(function(){
    this.viewport(400, 1000);
    phantomcss.screenshot('.c-featured-front__text', 'header');
  });

casper.run();

shanejeffers avatar Aug 31 '16 16:08 shanejeffers

If I pass in the absolute path to my user it works. For example, if I enter the following path it works:

/Users/username/Sites/test/index.html

But if I use the domain in my hosts file it fails:

local.dev/index.html

Any help would be appreciated.

shanejeffers avatar Aug 31 '16 19:08 shanejeffers

Sorry for the delayed response, I notice in your example above you're using https://local-hostname ? Is this URL accessable via https?

danbroooks avatar Nov 17 '16 11:11 danbroooks