Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 491417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T02:00:32+00:00 2026-05-13T02:00:32+00:00

When I view the source of the page in my browser (FireFox) (View->Page Source),

  • 0

When I view the source of the page in my browser (FireFox) (View->Page Source), copy it and paste it into my HTML editor, I view almost the same page (In this example it is http://www.google.com) as it appears in my browser. But when I get the HTML source through this code (through Googles App Engines)

from google.appengine.api import urlfetch
url = "http://www.google.com/"
result = urlfetch.fetch(url)
if result.status_code == 200:
   print result.content

copy it and paste it into my HTML editor, the page then looks quite different. Why is it so? Is there something wrong with the code?

++++++++++++++++++++++++++++++

Follow-up:

By this moment (Sunday, December 13th, 2009, 1:01 PM, GMT, to be precise) I have received two comments-questions (from Aaron and Christian P.) and one answer from Alex Martelli.

Both Aaron and Christian P. are asking about what actually is different between the Fire-Fox-obtained source and Google-App-Engine-obtained source when they are both displayed through the same HTML editor.

Here I have uploaded too screen shots:

One shows the Fire-Fox-obtained source

And the other one shows Google-App-Engine-obtained source

when they are both displayed through “MS Front Page” editor.

One difference, which is quite obvious, is different encoding: In Fire-Fox code everything is displayed in English, while in the Google-App-Engine code I get a lot of various symbols, instead.

Another difference is some additional lines at the top of the page in the Google App Engine code. I think, this is what Alex Martelli was talking about in his answer (“…the fetch-and-print approach is going to have metadata around it as well…”).

One more minor difference is that the box for the Google image is split into several boxes in one code, while it remains whole in the other one.

Alex Martelli suggested that I use this code (if I understood him correctly):

from google.appengine.api import urlfetch
url = "http://www.google.com/"
result = urlfetch.fetch(url)
if result.status_code == 200:
   print "content-type: text/plain"
   print

I’ve tried it, but in this case nothing is displayed at all.

Thank you all for your responses and, please, continue responding – I really want to see this issue finally resolved.

++++++++++++++++++++++++++++++

Follow-up:

Okay, the issue has been resolved.

I failed to pay my full attention to Alex Martelli‘s instructions and, therefore, came up with a wrong code. Here is he right one:

from google.appengine.api import urlfetch
url = "http://www.google.com/"
result = urlfetch.fetch(url)
if result.status_code == 200:
   print "content-type: text/plain"
   print
   print result.content

This code displays exactly what is needed – no additional lines at the top of the page.

Well, I still get the strange symbols, but I discovered that it’s probably Google’s problem. The thing is I am currently in Taiwan, and Google seems to be aware of that and automatically switches from http://www.google.com (which is in English) to http://www.google.com.tw (which is in Chinese), but this one, I guess, is already another topic.

Thanks to everyone who has responded here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T02:00:33+00:00Added an answer on May 13, 2026 at 2:00 am

    You have not explicitly emitted a “content type” header, and an end-of-headers empty line, so the first few lines are probably going to be lost; try adding before the final print something like

       print "content-type: text/plain"
       print
    

    Beyond this, what you’re getting in either case is essentially a big <script> with a little extra HTML around it — that’s all that Firefox is going to give you in the “view source” page, while the fetch-and-print approach is going to have metadata around it as well, e.g., the “doctype” (depending on what HTML editor you’re targeting, this may or may not be an issue).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 264k
  • Answers 264k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm pretty flakey on my objective-c knowledge but there's some… May 13, 2026 at 12:16 pm
  • Editorial Team
    Editorial Team added an answer Nope. Your understanding isn't quite right. The next node to… May 13, 2026 at 12:16 pm
  • Editorial Team
    Editorial Team added an answer On x86 the NOP instruction is XCHG AX, AX The… May 13, 2026 at 12:16 pm

Related Questions

When I view the source of the page in my browser (FireFox) (View->Page Source),
In my admin, I have a text area where the user can input html:
When I create a new page in asp.net and try to include the master
This is something of a follow-up question to my question here . You can
I am building an online article website. I have a php script called view_article.php

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.