Creating a site preview like in slack (using aiohttp)
In this article we will write a small library for creating a preview for a site. The description of how the preview works in slack you can check here.
4 Data sources will be used:
- Twitter Cards
- Open Graph
- HTML meta tags
In this exact order we will try to retrieve the data.
For parsing we will use:
Beautiful Soup — to navigate and search through the tree of an HTML document.
html5lib — to parse HTML documents, most correctly works with an invalid HTML markup.
aiohttp — an asynchronous client for receiving web pages + an asynchronous server.
Continue reading article here: Creating a site preview like in slack