Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Still learning, class var?
#1
Hello all, hope we have some patience for a beginner this morning.

I've written a weather scraper and it runs without any errors. My problem is one class_ has a variable of either high or low. My if statement returns a None value and I can't seem to figure it out. Any advice would be greatly appreciated.

time = current.find(class_='period-name').text
short_desc = current.find(class_='short-desc').text
temp = current.find(class_='temp temp-()')
if temp == ('low'):
		find(class_='temp temp-low').text
if temp == ('high'):
		find(class_='temp temp-high').text
weather.append(time)
weather.append(short_desc)
weather.append(temp)
~b4iknew
Reply


Messages In This Thread
Still learning, class var? - by b4iknew - Jan-24-2019, 03:26 PM
RE: Still learning, class var? - by Larz60+ - Jan-24-2019, 03:36 PM
RE: Still learning, class var? - by b4iknew - Jan-24-2019, 03:47 PM
RE: Still learning, class var? - by Larz60+ - Jan-24-2019, 03:57 PM
RE: Still learning, class var? - by Larz60+ - Jan-24-2019, 05:15 PM
RE: Still learning, class var? - by snippsat - Jan-24-2019, 06:01 PM
RE: Still learning, class var? - by b4iknew - Jan-24-2019, 08:33 PM

Forum Jump:

User Panel Messages

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