Resolved: I got the error while run the following code a['href'] and a['class']
import requests
from bs4 import BeautifulSoup
base_site="https://en.wikipedia.org/wiki/Music"
response=requests.get(base_site)
html=response.content
soup=BeautifulSoup(html,"html.parser")
a=soup.find_all("a",class_="mw-jump-link")
a['class']
1 answers ( 1 marked as helpful)
Just for surety did you check a by printing it, may be soup didn't find the class you are going through so a just has an empty list
so a['class'] might throws an error
Hope this would be helpful to you
Mayank