Python Forum
'NoneType' object is not subscriptable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'NoneType' object is not subscriptable
#2
Line 68 (which is missing in your post): bs.find() returns None if nothing were found.
The square brackets after bs.find() is the subscription.
First check the return value of bs.find() and if it is not None, then access the value.
If None was returned, then skip it.

Maybe the class attribute has a different name and/or the html-code has been changed.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: 'NoneType' object is not subscriptable - by DeaD_EyE - Aug-01-2020, 03:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I am getting this TypeError: 'TreasureMap' object is not subscriptable. makilakos 2 365 May-25-2024, 07:58 PM
Last Post: deanhystad
Bug TypeError: 'NoneType' object is not subscriptable TheLummen 4 980 Nov-27-2023, 11:34 AM
Last Post: TheLummen
  TypeError: 'NoneType' object is not callable akbarza 4 1,412 Aug-24-2023, 05:14 PM
Last Post: snippsat
  Python: Regex is not good for re.search (AttributeError: 'NoneType' object has no att Melcu54 9 1,896 Jun-28-2023, 11:13 AM
Last Post: Melcu54
  Help with python 'not subscriptable' error Extra 3 2,457 Dec-16-2022, 05:55 PM
Last Post: woooee
  TypeError: 'NoneType' object is not subscriptable syafiq14 3 5,496 Sep-19-2022, 02:43 PM
Last Post: Larz60+
  AttributeError: 'NoneType' object has no attribute 'group' MaartenRo 3 5,135 Jan-02-2022, 09:53 AM
Last Post: snippsat
  AttributeError: 'NoneType' object has no attribute 'group' MaartenRo 3 2,995 Jan-01-2022, 04:16 PM
Last Post: MaartenRo
  'int' object is not subscriptable after API call ed8484 1 1,941 Sep-18-2021, 02:06 PM
Last Post: ed8484
  Getting 'NoneType' object has no attribute 'find' error when WebScraping with BS Franky77 2 5,527 Aug-17-2021, 05:24 PM
Last Post: Franky77

Forum Jump:

User Panel Messages

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