jprichardson / node-google

A Node.js module to search and scrape Google.
MIT License
455 stars 115 forks source link

link.link doesn't work anymore #3

Closed thgie closed 11 years ago

thgie commented 11 years ago

I get this result when googling:

{ title: 'We Feel Fine / by Jonathan Harris and Sep Kamvar', link: null, description: 'www.wefeelfine.org/ - Cached - SimilarAn exploration of human emotion, in six movements by Jonathan Harris and Sep Kamvar. Open We Feel Fine. Book · Mission · Movements · Methodology ...‎We Feel - ‎We Feel Fine - ‎Movements - ‎Gallery' } . { title: 'iFeeL', link: null, description: 'www.ifeel.com.my/ - Cached - Similarifeel 1月杂志Promo. 搜寻 Search. ifeel 1月特号出版啦! Go Above 2013! ... Copyright � 2012 ifeel. All Rights Reserved. Scroll to Top. PRIVACY POLICY ...' } . { title: 'I Feel London', link: null, description: 'www.ifeellondon.com/ - Cached - Similarabout. Navigate your city by mood.' } . { title: 'I feel dizzy! - YouTube► 1:41www.youtube.com/watch?v=__dUlY0JpSc25 May 2012 - 2 min - Uploaded by TheDizzays8Waking up after anesthesia ORIGINAL VERSION http://www.ifeeldizzay.com.', link: null, description: '' }

Link is empty and the link is either in title or description.

jprichardson commented 11 years ago

Thanks for letting me know. Ill look into.

jprichardson commented 11 years ago

What's the query that you're Googling for?

jprichardson commented 11 years ago

I just ran the test, it still passes. I'm gonna need to know a search query to reproduce the problem. Thanks.

thgie commented 11 years ago

I actually encounter the problem using your example in the readme:

var google = require('google');

google.resultsPerPage = 25;
var nextCounter = 0;

google('node.js best practices', function(err, next, links){
  if (err) console.error(err);

  for (var i = 0; i < links.length; ++i) {
    console.log(links[i].title + ' - ' + links[i].link);
    console.log(links[i].description + "\n");
  }

  if (nextCounter < 4) {
    nextCounter += 1;
    if (next) next();
  }

});

results in

node.js Meetups - null
node-js.meetup.com/ - CachedGoals for the group are to spread ideas about Server Side Javascript, Node.js in   particular, socialize projects, and discuss the technology and best practices.

NodeKC (Kansas City, MO) - Meetup - null
www.meetup.com/nodekc/ - CachedAlthough most commonly used for HTTP networking, node.js works great for any ...Tue, Feb 19Node.js and non-HTTP networking

etc…

Thank you for responding.

jprichardson commented 11 years ago

It's been fixed now. There is a problem with Cheerio 0.10.5. I fixed the dependency to 0.10.4 and it solves the problem.

thgie commented 11 years ago

Just tried it and can confirm that it's fixed. Thanks alot.