from bs4 import BeautifulSoup, SoupStrainer import requests # get webpage html response = requests.get('https://www.example.com') page_html = response.text # create SoupStrainer object to parse only tags only_links = SoupStrainer('a') # create BeautifulSoup object with only_links filter soup = BeautifulSoup(page_html, 'html.parser', parse_only=only_links) # extract all links links = soup.find_all('a') # print links for link in links: print(link.get('href'))This example parses the `https://www.example.com` webpage and uses SoupStrainer to only parse `` tags. Then it extracts all the links and prints them. The library used in this example is `BeautifulSoup`, specifically the `SoupStrainer` class.