Why am I getting “HTTP Error 405: Method Not Allowed” when requesting a URL using urllib2?
The server you are calling is telling you that the POST method is not allowed for the URL you are trying to call.
By passing in the path portion of your URL as the Request
object data parameter you are making this a POST instead of a GET.
I suspect you wanted to send a GET request instead:
req = urllib2.Request(url + half_url.encode('utf-8'))