You're viewing a comment by securda and its responses.

July 01, 2011, 09:13

With new version of google xgoogle doesn't work anymore, i add this mod in and now work fine:

def _extract_results(self, soup):
results = soup.findAll('li','g')


def _extract_description(self, result):
desc_div = result.find('span', 'st'))


Comment Responses

max5555 Permalink
July 01, 2011, 20:14

Last line has to be like this
desc_div = result.find('span', 'st')

Thank you very much securda!

Xiangyuan Tang Permalink
July 12, 2011, 01:43

Hi Securda! Where should I add this in Thanks very much!

Helpful Person Permalink
July 18, 2011, 18:32

In in the xgoogle folder, look for two methods named _extract_results and _extract_description .
Change the assignment variables for results and desc_div to the new ones given. Old code has been commented out below and new code is present. Thanks securda!!! This works like a charm. :)

First method to change:
def _extract_results(self, soup):
#results = soup.findAll('li', {'class': 'g'})
results = soup.findAll('li','g')

Second method to change:
def _extract_description(self, result):
#desc_div = result.find('div', {'class': re.compile(r'\bs\b')})
desc_div = result.find('span', 'st')

HamSandwich Permalink
April 18, 2012, 21:55

i checked out master on github recently and this hack is still needed. afterwards it works great. thanks

nitinhardeniya Permalink
March 29, 2012, 14:14

Hey does the xgoogle still works with
num_results it's giving me always 0

Please help even your Google Fight is also giving 0 results

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "0day_139": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.