Issues in code while scraping data

import requests
from bs4 import BeautifulSoup
url = “Faculty of Economics | IIMA
response = requests.get(url)
soup = BeautifulSoup(response.content, “html.parser”)
soup.find_all(‘div’, {‘class’: ‘col-md-3 col-12 wow fadeInUp animated’})

Hi, I don’t understand why the last line is giving an empty list. I was expecting it will provide info on faculty.

It’s not finding anything because there’s no class with that name; class names cannot contain spaces. The ‘div’ element is using multiple classes, i.e. it’s using class ‘col-md-3’ and class ‘col-12’ and class ‘wow’, etc.

1 Like