scraperjs icon indicating copy to clipboard operation
scraperjs copied to clipboard

Error: Can't find variable: $

Open kubante opened this issue 7 years ago • 0 comments

Hi there, when trying to use the dynamicscraper i get error

Error: Can't find variable: $

My package.json looks like so:

"async": "^2.6.0",
"cheerio": "^1.0.0-rc.2",
"jquery": "^3.3.1",
"phantom": "^4.0.12",
"phantomjs": "^1.9.8",
"request": "^2.83.0",
"scraperjs": "^1.2.0"

my scraper is pretty basic:

var scraperjs = require('scraperjs');

scraperjs.DynamicScraper.create('https://SOME_url') .scrape(function($) { return $(".a13adeccca0d0e02 a").map(function() { return $(this).attr('href'); }).get(); }) .then(function(news) { console.log(news); })

kubante avatar Feb 20 '18 10:02 kubante