error in fetching url data

Posted by Rahul s on Stack Overflow See other posts from Stack Overflow or by Rahul s
Published on 2010-03-12T16:26:58Z Indexed on 2010/03/12 16:27 UTC
Read the original article Hit count: 221

Filed under:

from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.ext import db from google.appengine.api import urlfetch

class TrakHtml(db.Model): hawb = db.StringProperty(required=False) htmlData = db.TextProperty()

class MainHandler(webapp.RequestHandler): def get(self): Traks = list() Traks.append('93332134') #Traks.append('91779831') #Traks.append('92782244') #Traks.append('38476214')

for st in Traks :
  trak = TrakHtml()
  trak.hawb = st
  url = 'http://etracking.cevalogistics.com/eTrackResultsMulti.aspx?sv='+st

  result = urlfetch.fetch(url)
  self.response.out.write(result.read())

  trak.htmlData = result.read()
  trak.put()

result.read() is not giving whole file , it giving some portion. trak.htmlData is a textproparty() so it have to store whole file and i want that only

© Stack Overflow or respective owner

Related posts about python