0
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()
#self.response.out.write(st)
def main():
application = webapp.WSGIApplication([('/', MainHandler)],
debug=True)
util.run_wsgi_app(application)
if __name__ == '__main__':
main()
我得到錯誤在***線它不讀取網址數據。如何讀取網址數據
巨文是巨人。你有我的關注嗎? – Urda 2010-03-12 14:09:18
請刪除版權聲明和與您的問題沒有直接關係的其他代碼,以便於閱讀。 – Mat 2010-03-12 14:11:33
實際上,發佈版權聲明在這裏是非常棘手的事情:我們已經在這裏發佈的所有內容使用許可。我不確定你可能會改變... – 2010-03-12 14:16:54