Last answered:

26 Jun 2020

Posted on:

26 Jun 2020

0

Help with Youtube exercise

I am trying to do the exercise about scraping Youtube, however soup fails in even finding all the span tags. Going through the raw HTML I dumped to file I get a count of 700+ when searching for '<span', while soup only finds about a fifth of all those tags. Same with images, the only img tags soup finds are '<img alt' while there are plenty of other '<img' tags. What am I doing wrong? My code:
soup.find_all('span')
soup.find_all('img')
1 answers ( 0 marked as helpful)
Instructor
Posted on:

26 Jun 2020

0
Hi Freek, That might happen if the HTML was not parsed correctly by the parser, and thus some of the tags may be missing in the BeautifulSoup object. Also, be careful that the soup variable is not some old instance that contains an old document. Best, 365 Team

Submit an answer