Search code examples
pythonhtmlweb-scrapingfavicon

how to find the favicon of a website with python with Beautifulsoup


i need to do a little program that would be able to find the favicon of a website like the one of YouTube or google but i didn't found any exemple on google i already tried to do a code that can find picture on Wikipedia with Beautifulsoup but not the little image of the title.

Thanks for helping


Solution

  • You don't need bs4.

    The icon is just a static file with the name "favicon.ico" .

    For exsample, the favicon of stack overflow is at "www.stackoverflow.com/favicon.ico"

    And the favicon of Google is at "www.google.com/favicon.ico"

    etc.