The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Help with Youtube exercise

Help with Youtube exercise

0
Votes
1
Answer

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 Answer

0
Votes

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

×
Learn Data Science
this Summer!
Get 50% OFF