-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running the example doesn't work #37
Comments
Umm, I'm on it. Testing. |
Cannot reproduce it. I Can you post the output of |
Closing due to no response. |
I get the same thing with both 6.9.2 and 7.2.1. All I'm doing is using the readme example. Even simplifying it results in the same thing. |
@freshyill Hmm... Weird. If you do a |
Yep, I get the expected result with curl. Seems to work just fine. |
What about running the tests? Are they passing? |
Hi, npm ERR! git clone git@github.com:github:chalk/ansi-styles Clonage dans le dépôt nu '/home/paul/.npm/_git-remotes/git-github-com-github-chalk-ansi-styles-0915ce26' npm ERR! System Linux 4.9.0-2-amd64 |
A google search lead me to this issue: this work: here are the lines in npm-debug.log:
|
Hi, Just tried this package today and got similar issue. Error I'm getting is: Even with first and most basic example on github.
|
@mirkojotic Do the tests pass? I'm not sure. |
I think the issue is that the syntax has changed for the {opts} parameter and the example posted here does not work. This works: // Fetch the articles on the page (list)
scrapeIt("http://ionicabizau.net", {
articles : {
listItem: ".article"
, data: {
createdAt: {
selector: ".date"
, convert: x => new Date(x)
}
, title: "a.article-title"
, tags: {
selector: ".tags"
, convert: x => x.split("|").map(c => c.trim()).slice(1)
}
, content: {
selector: ".article-content"
, how: "html"
}
}
}
}, (err, page) => {
console.log(err || page);
}); This does not work (taken from blog post): // Fetch the articles on the page (list)
scrapeIt("http://ionicabizau.net", {
listItem: ".article"
, name: "articles"
, data: {
createdAt: {
selector: ".date"
, convert: x => new Date(x)
}
, title: "a.article-title"
, tags: {
selector: ".tags"
, convert: x => x.split("|").map(c => c.trim()).slice(1)
}
, content: {
selector: ".article-content"
, how: "html"
}
}
}, (err, page) => {
console.log(err || page);
}); Note, the change in structure for {opts}; each key is now the "name" of the scraped list. |
@powlo Phew! 🙈 Good point! Updated the example in that post too! |
Hi there,
The example found in the readme does not work when running it.
Here is the output when running it. Perhaps I'm being dumb but this is the result of running
node app.js
The text was updated successfully, but these errors were encountered: