I am trying to make an application that would query Wikipedia, but when I try to use the URL Fetch service I run into an exception. The same code works for fetching both Google and Facebook. I am very inexperienced with Python web development and App Engine. Does anyone else run into the same problem with Wikipedia or can anyone confirm this?
Code Snippet
import os
import urllib2
from google.appengine.ext.webapp import template
class MainHandler(webapp.RequestHandler):
def get(self):
url = "
http://en.wikipedia.org/wiki/Do-support"
try:
result = urllib2.urlopen(url)
except urllib2.URLError, e:
result = 'ahh the sky is falling'
template_values= {
'test':result,
}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))