• official API for Beautiful Soup

  • how to make soup

    req = requests.get("website_url")
    soup = BeautifulSoup(req.text, 'lxml') 
    
    
  • if you just want to find one or select one instance (will be the first one it finds), use .find() or select_one() with same arguments as their counterparts

  • soup.find_all(args): in general it will return all elements that satisfy the provided args

  • soup.select(args): similar to find_all but you can chain arguments and it’s slightly more efficient; easier to use w/ css selectors

  • tip: to get the value of element attributes you can treat the elements in the soup as if they were each dictionaries

    • ex: let’s say we get the a tags from our soup
      • to get the links we do
        • link = a[”href”]