Just load the /favicon.ico file using GET or something similar (as with any other file).
You can also analyze the page to find an icon, which could also be png. By default, this is an ICO file.
The location of the favicon file is usually located in the <link rel="shortcut icon" href="/favicon.ico" /> in the <head> node of the page.
In addition, some browsers by default try to load /favicon.ico (that is, the favicon.ico file in the websiteβs root folder) without checking the page for this element. p>
Another idea is to use Google S2:
http://www.google.com/s2/favicons?domain=youtube.com (Try it)
This will give you a 16x16 PNG image of the youtube ICU icon.
http://www.google.com/s2/favicons?domain=stackoverflow.com (Try it)
This will give you a stackoverflow background icon in the same format.
This may seem surprising, but do not forget, this Google service is not officially supported , and they can remove it at any time.
source share