Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:00:21+00:00 2026-06-06T14:00:21+00:00

Logical flow of the scraper: article links extracted from an XML feed are put

  • 0

Logical flow of the scraper: article links extracted from an XML feed are put into a list called self.raw_html. The following [simplified] method is then called to filter out the container the articles are in and remove text from the given articles:

def fetch_article_contents(self):
    for article in self.raw_html:
        self.css_selector_type == 'class':
        soup = article.find(self.html_element,
                            self.css_selector)
        soup = soup.get_text()
        self.article_html.append(soup)
    return self.article_html

This works well on most feeds, but on two notable exemptions (Forbes and Official Google Blog) fails with the following message when get_text() is called:

AttributeError: 'NoneType' object has no attribute 'get_text'

My first logical step in debugging was to see what was returning a NoneType object, so I stuck a print type(soup) right before soup = soup.get_text(). I found:

<class 'bs4.element.Tag'> (25 times, condensed to save space)
<type 'NoneType'>

This also strikes me as strange because there are currently 29 articles in self.raw_html when fetching the Forbes XML feed as verified by len(self.raw_html) when the class is initalized.

The Google Official Blog returns:

<class 'bs4.element.Tag'> (just once this time)
<type 'NoneType'>

and in reality has 25 fetched articles.

What is the problem I’m encountering? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:00:23+00:00Added an answer on June 6, 2026 at 2:00 pm

    You don’t show what self.html_element and self.css_selector are, but it seems clear the the article.find method is not finding them, and returning None.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Java classes are generally divided into logical blocks. Is there a convention to mark
This is the logical flow for my application: At first, when the view controller
From a logical perspective it sometime doesn't make sense, for example, to add an
Application flow An input file consists of multiple logical documents. Extract one input logical
From a logical point of view an application may need dozens or hundreds of
I am separating out logical sections into fragment *.wxs files, but how do I
From a logical perspective this is the kind of routing behaviour I wish to
Given a table of logical resource identifiers (one per row), what is the best
Is there a logical way to strip out function names and their arguments using
Inputs: arbitrary logical vectors (~2M elements): i1,i2,...,in arbitrary logical expression: eg. or(and(not(i1),i2),xor(i3,i4)) Output: resulting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.