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 8345811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:48:18+00:00 2026-06-09T06:48:18+00:00

I have recently upgrade BeautifulSoup from version 3.0 to version 4.1 on a Windows

  • 0

I have recently upgrade BeautifulSoup from version 3.0 to version 4.1 on a Windows machine.

I am now getting a strange error:

File "C:\path\to\myscript.py", line 23
0, in soupify
    return BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_ENTITIES)
AttributeError: type object 'BeautifulSoup' has no attribute 'HTML_ENTITIES'

Here is the snippet of code that causes the exception to be thrown:

def soupify(html):
    return BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_ENTITIES)

The doc for BS does not mention how the constructor signature has changed fro v3 to v4. How may I fix this?

  • 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-09T06:48:20+00:00Added an answer on June 9, 2026 at 6:48 am

    An incoming HTML or XML entity is always converted into the
    corresponding Unicode character. Beautiful Soup 3 had a number of
    overlapping ways of dealing with entities, which have been removed.
    The BeautifulSoup constructor no longer recognizes the smartQuotesTo
    or convertEntities arguments.
    (Unicode, Dammit still has
    smart_quotes_to, but its default is now to turn smart quotes into
    Unicode.)

    If you want to turn those Unicode characters back into HTML entities
    on output, rather than turning them into UTF-8 characters, you need to
    use an output formatter.

    Source: http://www.crummy.com/software/BeautifulSoup/bs4/doc/#entities

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

Sidebar

Related Questions

I recently upgrade Django from v1.3.1 to v1.4. In my old settings.py I have
I have recently upgraded my ASP.NET MVC application from beta to version 1. And
Referring to the plugin: http://malsup.com/jquery/form/#getting-started I've recently tried to upgrade from old v2.28 to
I have recently attempted to upgrade a solution from VS2010 to VS2012, and as
I have recently upgrade from shared hosting to VPS hosting. But the VPS is
Recently we have decided to upgrade a website from 1.1 to 2.0. We used
Our dev server was recently upgraded to PHP v5.2.13. With that upgrade we have
We have recently upgraded from SQL Server 2005 to SQL Server 2008 (R2, SP1).
We have recently upgraded from Delphi 2009 to 2010. One of the things in
I have recently upgraded from websphere 5.1.2 to websphere 6.1 server. I had some

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.