ruipgil / scraperjs

A complete and versatile web scraper.
MIT License
3.7k stars 188 forks source link

Error: Can't find variable: $ #77

Open kubante opened 6 years ago

kubante commented 6 years ago

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); })