Skip to content

DynamicScraper can not run #73

@willin

Description

@willin
yarn global add phantomjs-prebuilt
// ./doc/examples/HackerNews.js
var sjs = require('../../src/Scraper');
/*
 Scrape the news in Hacker News.
 */
sjs.DynamicScraper
	.create('https://news.ycombinator.com')
	.scrape(function ($) {
		return $('.title a').map(function () {
			console.log($(this).text());
			return $(this).text();
		}).get().filter(function (elm) {
			return elm != 'More';
		});
	})
	.then(function (news) {
		news.forEach(function (elm) {
			console.log(elm);
		});
	}).catch(function (err) { 
		console.error(err);
	});

run and did not get any result...

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