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 9203825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:33:32+00:00 2026-06-17T23:33:32+00:00

I fetched the http://gmail.com source code from browser and by file_get_contents, both are different.

  • 0

I fetched the http://gmail.com source code from browser and by file_get_contents, both are different.

How can i get same source code which is showing in browser, using php or js or any other programming language (But i preffer php or js)

  • 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-06-17T23:33:34+00:00Added an answer on June 17, 2026 at 11:33 pm

    gmail.com almost certainly does User Agent sniffing to alter the output according to the browser making the request (despite it being considered bad practice and despite google penalising others for doing it). So my guess is that you’re unlikely to get the same source code even between two different browsers, let alone if you fetch it with file_get_contents.

    You might get somewhere if you use the cURL library instead, and spoof the UA string, but I wouldn’t count on even that working completely.

    But even if you do that and it works, gmail.com as a site is really heavily dependent on dynamically loaded content; even parts of the script are only loaded when required. I can’t see any possible way that loading the gmail site into a PHP script could be remotely useful. And even if you do get it loaded as you want to, what then? They’re constantly changing the code, so trying to write a program to parse the HTML code will be an exercise in futility and frustration.

    I guess the real question is what are you trying to achieve here? If you want to load your mail from gmail, they provide proper APIs for that kind of thing, which will work much better and more reliably than trying to parse the gmail site itself. I can’t think of many other reasons you’d want to do this, so perhaps you should look into the APIs.

    The Gmail API for PHP can be downloaded here: http://code.google.com/p/gmail-api/downloads/detail?name=gmail-api.v0.1.php

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

Sidebar

Related Questions

The script I used fetched a file from https://www.dropbox.com/browse_plain/ $REMOTEDIR?no_js=true which now returns: HTTP/1.1
http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html the api is : Downloading Data from App Engine To start a data
Fetched below given text from http://docs.oracle.com/html/E24396_01/ejb3_overview_why.html Serialization is Java's built-in mechanism for transforming an
This is the code taken from http://code.google.com/p/crawler4j/ and the name of this file is
I have few images on a web page which are fetched from HTTP server
I have a hidden property which is fetched from ebean. how do i pass
I have a string that I fetched from an Apache server over HTTP: -
Example: http://franklovecchio-playback.herokuapp.com/?log=true Full code: https://github.com/franklovecchio/playback You'll see the undefined attributes come through on the
you can refer to this example http://www.html5canvastutorials.com/kineticjs/html5-canvas-load-complex-stage-with-kineticjs/ M trying to achive the same thing
The example code is from here : def http_get(url) f = Fiber.current http =

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.