Home > PHP > See source code of a website

See source code of a website


We all know that, after visiting any website with browser, you can inspect the source code (HTML and JavaScript)simply by using

  • in Mozilla Firefox: View -> Page Source (or the key combination CTRL U)
  • in Microsoft Internet Explorer:  View -> Source
  • in Google Chrome: Tools -> View Source (or CTRL U).

But if you have doubts about the content of a web page and you want to inspect the source without loading it into the browser?

Firefox and Chrome offer a simple function to invoke.

Typing view-source: followed by the URL of the webpage to visit, the browser will not pass the source code to the rendering engine but it limit to expose the content of a web page in a window.

Try typing in the address bar of Firefox or Chrome

view-source: http://www.google.it

the browser will immediately display the HTML source of the page shown.

The command view-source: can be useful for expert users to analyze the source code  of a website before you visit, especially if you have doubts about its content. This is, we believe, a very nice feature that eliminates the need for more complex procedures (such as downloading the page via wget).

Advertisements
Categories: PHP
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: