Attempting the same tests in a console reveal the problem to be here:
def search(self, search_string): """ Searchs Yahoo for location in search_string and returns list of tuples @param search_string String @return list(tuple(location_id String, PlaceName String)) """ response = self.find_weather_search_results_page(search_string)
if response.status == 302: redirect_url = response.getheader('location', '') the_code = redirect_url[10:len(redirect_url)-5]
the_placename = self.get_location_from_id(the_code)
return [(the_code, the_placename)] else: return []
The actual response.status is 301, although simply changing the if statement to 301 does not fix it. I did not investigate it further.
Attempting the same tests in a console reveal the problem to be here:
def search(self, search_string): location_ id String, PlaceName String)) weather_ search_ results_ page(search_ string)
"""
Searchs Yahoo for location in search_string and returns list of tuples
@param search_string String
@return list(tuple(
"""
response = self.find_
if response.status == 302:
redirect_ url = response. getheader( 'location' , '')
the_ code = redirect_ url[10: len(redirect_ url)-5]
return [(the_code, the_placename)]
else:
return []
The actual response.status is 301, although simply changing the if statement to 301 does not fix it. I did not investigate it further.