I just want to extract all the five a-tag data list of card which is nested the div tag as shown in the picture. How could I extract it?
I have tried this one,
btag = []
for data in soup.find_all('div', id="mosaic-provider-jobcards"):
for atag in data:
atag = soup.find_all('a').append(btag)
print(btag)
but it showed none. Can anyone help?
You can use CSS selectors:
soup.select('#mosaic-provider-jobcards > a')
https://www.crummy.com/software/BeautifulSoup/bs4/doc/#css-selectors