Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
In search.py 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')
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Education Sponsors
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
With new version of google xgoogle doesn't work anymore, i add this mod in search.py and now work fine:
def _extract_results(self, soup):results = soup.findAll('li','g')
and
def _extract_description(self, result):desc_div = result.find('span', 'st'))
thanks!
Comment Responses
Last line has to be like this
desc_div = result.find('span', 'st')Thank you very much securda!
Hi Securda! Where should I add this in search.py? Thanks very much!
In search.py 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')
i checked out master on github recently and this hack is still needed. afterwards it works great. thanks
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