user
Write a web crawler to extract emails from a website.

Answer:
assistant
import requests 
from bs4 import BeautifulSoup

def crawler(url):
    # Request the page from the given URL
    resp = requests.get(url)
    # Create the BeautifulSoup object
    soup = BeautifulSoup(resp.text, 'html.parser')
    
    # Find all email addresses on the page
    emails = [a.attrs.get('href') for a in soup.select('a[href^=mailto:]')]
    
    return emails