>From doing the urlfetch.url checking the status code to be 200 and
viewing the content, it returns the html with
Status: 200 OK
Last-Modified: Sat, 20 Sep 2008 03:47:52 GMT
ETag: e608d454f548741614b550558645b689
Content-Type: text/html; charset=utf-8
Expires: Sat, 20 Sep 2008 03:47:51 GMT
Cache-Control: max-age=0

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>

on top of the html ie this is what req.content is , and somehow it
manages to permeate to my response object messing up my page...pliz
advise














On Sep 20, 2:22 am, Alexander Kojevnikov <[EMAIL PROTECTED]>
wrote:
> Your Django code looks fine to me. Did you try debugging it? What does
> req.content return?
>
> On Sep 20, 12:51 am, uo <[EMAIL PROTECTED]> wrote:
>
> > Alexander Kojevnikov wrote:
> > > fetch() returns a Response object. I guess you are writing it to the
> > > output stream which results in all information being shown, including
> > > the headers.
>
> > > Instead you need to output only the content. If you are using the
> > > webapp framework the code will look like this:
>
> > >     response = urlfetch.fetch(URL)
> > >     self.response.out.write(response.content)
>
> > >http://code.google.com/appengine/docs/urlfetch/responseobjects.html
>
> > > On Sep 19, 9:03 am, uo <[EMAIL PROTECTED]> wrote:
> > > > Hey people thanks for all your help.I have a problem with
> > > > urlfetch...im harvesting data from a webpage which i get using
> > > > urlfetch,fetch(url) .After im done parsing the pages and i try to
> > > > render the info,,, it renders badly as on top i get to see the
> > > > headers.. ir content-type status...etc and consequently the page
> > > > doesnt render and the html code is shown as is.How can i remove the
> > > > headers? Pliz help
>
> > What are my options if im using the django framework...where i dont
> > deal with the webapp.RequestHandler class directly but rather through
> > urls.py through urls which return a  HttpResponse object.I have
> > tried    req=urlfetch.fetch(url)
>
> > response= HttpResponse()
>
> > response.write(req.content)
>
> > return response
>
> > but it gives me the very same ugly looking page , with unrendered html
> > tags and furthermore it replaces the tags i put in the templates
> > putting &lt; and &gt; in place of < and >.Anyone pliz help
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to