Python Forum
AttributeError: 'NoneType' object in a parser - stops it
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AttributeError: 'NoneType' object in a parser - stops it
#2
It looks like soup.find("h3", class_="screen-reader-text") has not found anything.
You could either break this line up and only call find_next if there was a result or use a try/except that captures the AttributeError.
Reply


Messages In This Thread
RE: AttributeError: 'NoneType' object in a parser - stops it - by Yoriz - May-09-2021, 10:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  AttributeError: 'ellipsis' object has no attribute 'register_blueprint' Mechanicalpixelz 2 2,501 Dec-29-2021, 01:30 AM
Last Post: Mechanicalpixelz
  BeautifulSoup: 6k records - but stops after parsing 20 lines apollo 0 1,852 May-10-2021, 05:08 PM
Last Post: apollo
  AttributeError: ResultSet object has no attribute 'get_text' KatMac 1 4,473 May-07-2021, 05:32 PM
Last Post: snippsat
  Python 3.9 : BeautifulSoup: 'NoneType' object has no attribute 'text' fudgemasterultra 1 9,036 Mar-03-2021, 09:40 AM
Last Post: Larz60+
  Code stops after 20min+ with no output JacobK 1 1,769 Apr-03-2020, 07:01 PM
Last Post: Larz60+
  AttributeError: 'str' object has no attribute 'xpath' nazmulfinance 4 10,613 Nov-11-2019, 05:15 PM
Last Post: nazmulfinance
  AttributeError: 'str' object has no attribute 'xpath' nazmulfinance 0 3,138 Nov-10-2019, 09:13 PM
Last Post: nazmulfinance
  AttributeError: 'Response' object has no attribute 'replace' Truman 12 23,719 Mar-20-2019, 12:59 AM
Last Post: ichabod801
  AttributeError: 'dict' object has no attribute 'is_active' (PyMongo And Flask) usman 0 5,029 Nov-20-2018, 09:50 PM
Last Post: usman
  BeautifulSoup 'NoneType' object has no attribute 'text' bmccollum 9 14,806 Sep-14-2018, 12:56 PM
Last Post: bmccollum

Forum Jump:

User Panel Messages

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