Skip to content
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

1.6.31 breaks parsing wikipedia articles #41

Closed
davidcameron opened this issue Jun 7, 2017 · 5 comments
Closed

1.6.31 breaks parsing wikipedia articles #41

davidcameron opened this issue Jun 7, 2017 · 5 comments

Comments

@davidcameron
Copy link

I get nothing back when calling .getArticle on a Wikipedia article (try https://en.wikipedia.org/wiki/Ramen).

1.6.2 returns <head> tags for Wikipedia articles. 1.6.15 works correctly with Wikipedia articles.

@ndaidong
Copy link
Collaborator

@davidcameron thanks. I will take a look on this case.

ndaidong added a commit that referenced this issue Jun 13, 2017
- Fix issue with Wikipedia (ref #41)
@ndaidong ndaidong mentioned this issue Jun 13, 2017
ndaidong added a commit that referenced this issue Jun 13, 2017
@ndaidong
Copy link
Collaborator

@davidcameron A script to handle Wikipedia link has been added to v1.6.4, please check if it works for you now.

@davidcameron
Copy link
Author

davidcameron commented Jul 11, 2017

This still doesn't seem to work for me, running v1.6.4:

var fetch = require('node-fetch');
var parser = require('article-parser');
var fs = require('fs');

var articleUrl = 'https://en.wikipedia.org/wiki/Ramen';

fetch(articleUrl)
.then(res => {
    return res.text();
})
.then(html => {
    //console.log('html', html);
	parser.getArticle(html).then(stuff => {
        console.log('done', stuff);
        fs.writeFile('./ramen.html', stuff, function (e) {
            e && console.log('file error', e);
        });
    });

});

^ Logs and writes an empty response.

@ndaidong
Copy link
Collaborator

@davidcameron I think it was resolved with v2.0.0-rc I've just released. Please help me test if it works. Thanks.

@ndaidong
Copy link
Collaborator

@davidcameron : after a week of testing, it looks like the problem has been resolved as well by v2.x.x, so I would close this issue now. Feel free to reopen if it still not works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants