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))
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/x62nL9nPwKEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.