Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.42k stars 436 forks source link

ReferenceError: Can't find variable: Symbol #727

Closed perfectacle closed 6 years ago

perfectacle commented 6 years ago

I want to get last page number in site (https://www.rocketpunch.com/jobs?keywords=%ED%94%84%EB%A1%A0%ED%8A%B8&q=)

// app.js
var page = require('webpage').create();
var URI = 'https://www.rocketpunch.com/jobs?keywords=%ED%94%84%EB%A1%A0%ED%8A%B8&q=';

page.open(URI, function() {
  var totalPage = page.eval(function() {
    var selector = '#search-results > div.ui.blank.right.floated.segment > div > div.tablet.computer.large.screen.widescreen.only > a:last-child';
    return document.querySelector(selector).getAttribute('data-query-add').split('=')[1];
  });
  console.log(totalPage);

  phantom.exit();
});
npx phantomjs app.js

but I saw only error message

ReferenceError: Can't find variable: Symbol
  https://static.rocketpunch.com/bundle/analytics.2570344dd92c244e9e99.js:1 in f
  https://static.rocketpunch.com/bundle/analytics.2570344dd92c244e9e99.js:1 in init
  https://static.rocketpunch.com/bundle/analytics.2570344dd92c244e9e99.js:1
  https://static.rocketpunch.com/bundle/analytics.2570344dd92c244e9e99.js:1 in t
  https://static.rocketpunch.com/bundle/analytics.2570344dd92c244e9e99.js:1
  https://static.rocketpunch.com/bundle/analytics.2570344dd92c244e9e99.js:1 in t
  https://static.rocketpunch.com/bundle/analytics.2570344dd92c244e9e99.js:1

It is PhantomJS's bug? PhontomJS doesn't support ES2015 Syntax? How can I solve this probrem...?

please help me!!

connor4312 commented 6 years ago

Yes, PhantomJS does not and will not support ES2015

perfectacle commented 6 years ago

Thanks @connor4312, so I close this issue.