Python Forum
'NoneType' object is not subscriptable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'NoneType' object is not subscriptable
#4
You can run for example the Python repl (or better IPython) with your program in interactive mode.

python3 -i your_program.py
Then the exception will appear and then you can use the b or bs object.

Open your browser, press F12 and select the html element you want to inspect.
Then you'll see the class names. Then try in the python repl to find the element.


Sometimes you get different results with requests and a real browser,
because some pages are manipulating the DOM with JavaScript.

In this case you could try: https://pypi.org/project/requests-html/
A step further is selenium, which controls a headless remote browser (Firefox, Chrome).
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, 04:32 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