Just download the /favicon.ico file using a GET or something similar (like you would for any other file).
You can also parse the page to find the favicon that might be also a png. By default it's an ICO file.
The location of favicon file is usually in <link rel="shortcut icon" href="/favicon.ico" />
in the <head>
node of the page.
Also, some browsers by default try to download /favicon.ico (that is, the favicon.ico file in the root folder of the website) without checking the page for that element.
Other idea would be using Google's S2:
http://www.google.com/s2/favicons?domain=youtube.com
(Try it)
This will get you a 16x16 PNG image of youtube's ICO favicon.
http://www.google.com/s2/favicons?domain=stackoverflow.com
(Try it)
This will get you the stackoverflow favicon in the same format.
It might seem awesome but don't forget, this Google service is not officially supported and they might remove it at anytime.