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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:24:10+00:00 2026-06-09T03:24:10+00:00

I am having a strange error using BeautifulSoup. Here is a snippet of the

  • 0

I am having a strange error using BeautifulSoup.

Here is a snippet of the code I am running:

while True:
    listing_soup = soupify(urlget(page_url))
    for i in listing_soup.findAll('div', 'searchResultContent'):
       # do some stuff ...

Here is the exception being thrown:

Traceback (most recent call last):
  File "C:\path\to\script.py", line 71
6, in <module>
    for i in listing_soup.findAll('div', 'searchResultContent'):
  File "c:\python27\BeautifulSoup.py", line 612, in findAll
    return self._findAll(name, attrs, text, limit, generator, **kwargs)
  File "c:\python27\BeautifulSoup.py", line 275, in _findAll
    strainer = SoupStrainer(name, attrs, text, **kwargs)
  File "c:\python27\BeautifulSoup.py", line 660, in __init__
    self.attrs=attrs.copy()
AttributeError: 'str' object has no attribute 'copy'

I am running Python 2.7.3 on Windows XP Professional. This script worls fine on Ubuntu Linux.

Note:

I am expecting the data from the web to be UTF, so the python script starts with the following line:

# coding=utf-8

  • 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-09T03:24:12+00:00Added an answer on June 9, 2026 at 3:24 am

    Judging from the line numbers, you’re using Beautiful Soup 3.0.0, which doesn’t have the “search by CSS class” shortcut you’re trying to use (it was reintroduced in 3.0.1). More to the point, you’re using a version of the software that’s five years old. I recommend Beautiful Soup 4 for all new projects.

    Most likely you don’t see the problem on Ubuntu because your Ubuntu installation is running a more recent version of Beautiful Soup.

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

Sidebar

Related Questions

I'm having strange error with installing fixture from dumped data. I am using psycopg2,
I'm having a strange issue here, i have this bit of code: <?php if
I am having a strange linking error. I followed instructions presented here to avoid
I am having a really strange error when using the iif() statement in SSRS
I am having a strange issue with jScrollPane plugin. After several days of using
So I'm having a very strange error right now. I found where it happens,
Ok so I'm having some strange issue with an mvc 3 site using javascript
I'm having a strange problem while attempting to transform a blocking socket server into
I'm having some strange issues with decoding an XML snippet, contained with a cookie,
I am having a very, very strange error, probably related to memory management (even

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.