Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nested looping issue
#4
what do you expect will happen if findAll doesn't find anything?
for data in soup.findAll('div',{'class':'ml1-SoccerStatsBar '}): 
The loop will never execute!
the statement: ('div',{'class':'ml1-SoccerStatsBar '})
means to find all div tags who have a class='ml1-SoccerStatsBar ' (including the space since it's part of the string.
As stated before, that web page doesn't have a single entry that satisfies that case.
Reply


Messages In This Thread
Nested looping issue - by smk90 - Sep-24-2018, 06:42 PM
RE: Nested looping issue - by Larz60+ - Sep-24-2018, 10:51 PM
RE: Nested looping issue - by stullis - Sep-24-2018, 11:01 PM
RE: Nested looping issue - by Larz60+ - Sep-24-2018, 11:44 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020