To extract HTML elements with a specific class name using BeautifulSoup, we use the attrs parameter of the functions find or find_all.