/    Sign up×
Community /Pin to ProfileBookmark

How does Google hide results in javascript?

How does Google hide results in javascript?

I know that the content of a search engine is copyrighted. I am only interested in saving the results of a search in a more automated fashion for my own personal use.

Now, years ago, when the internet was young, a friend of mine and I used to discuss how a web site could hide it source from the browser. Let me explain. In Internet Explorer, one can easily find out how a web site’s HTML code looks like by just going to the menu and clicking View->Source (the menu is still there, by the way, just like in the old days, you just need to hit the ALT key).

All of the source code, that is, all of the HTML code used to make a web page is right there for anyone to see. This is the spirit of the internet, as being all open and honest to the user. I guess they did this for anyone who was paranoid about subliminal advertising or hidden graphics so that THE MAN could not use is mind control… or whatever.

Well Google, it seems, has managed to hide how their content from people who take a peek at the HTML of a search ressults page. It seems to be nested deeply in the JAVASCRIPT.

So my question is this. Is there some why I can decode this with a little basic understanding of javascript, or is it lost forever?

When I open a browser; go to google.com; search on “test string” I get my first page of results. Then if I click on the browser menu to save the source code as “data.html” and then open “data.html” inside the browser, it shows the google home page instead of the results page. How does google do this trick and how can I get the results page programatically.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@ReFreezedOct 23.2012 — When you save the page you only save the original html code and not whatever is inserted by JavaScript, as you might have guessed. How exactly Google does this is probably very complicated as it involves JavaScript fetching data dynamically from their servers after the page has loaded and inserting it into the page in different ways.

Anyway, if you want to see and copy/save the altered html code and you're using Firefox you can use the Firebug add-on to do so. Or if you're using Google Chrome you can just hit F12 to see everything. I'm not sure how to do it in Internet Explorer.

Edit: and just to clarify something - JavaScript is very commonly used to insert elements into the page after it has loaded, it's not just Google who does it. And the JavaScript code is just as visible as the html code, so they are not really hiding anything. ?
×

Success!

Help @complete spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...