Skip to content

Error: Can't find variable: $ #77

@kubante

Description

@kubante

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions