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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:01:18+00:00 2026-06-03T00:01:18+00:00

During a parsing process using scrapy I have found this output [u’TARTARINI AUTO SPA

  • 0

During a parsing process using scrapy I have found this output

[u’TARTARINI AUTO SPA (CENTRALINO SELEZIONE PASSANTE)’],”[u’V. C.BONAZZI\xa043′, u’40013′, u’CASTEL MAGGIORE’]”,[u’0516322411′],[u’info@tartariniauto.it’],[u’CARS (LPG INSTALLERS)’],[u’track.aspx?id=0&url=http://www.tartariniauto.it’]

As you see there are some extra character like

u’ \xa043 ” ‘ [ ]

Which I don’t want .
How can I remove these ??
Besides there are 5 items in this string . I want the string look like this :

item1 , item2 , item3 , item4 , item5

Here is my pipelines.py code

from scrapy.contrib.loader import ItemLoader
from scrapy.contrib.loader.processor import TakeFirst, MapCompose, Join
import re
import json
import csv

class InfobelPipeline(object):
    def __init__(self):
      self.file = csv.writer(open('items.csv','wb'))
    def process_item(self, item, spider):
      name = item['name']
      address = item['address']
      phone = item['phone']
      email = item['email']
      category = item['category']
      website = item['website']
      self.file.writerow((name,address,phone,email,category,website))
    return item

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-03T00:01:19+00:00Added an answer on June 3, 2026 at 12:01 am

    The extra characters you’re seeing are unicode strings. You’ll see them a lot if you’re scraping on the web. Common examples include copyright symbols: © unicode point U+00A9, or trademark symbols ™ unicode point U+2122.

    The quickest way to remove them is to try to encode them to ascii and then throw them away if they’re not ascii characters (which none of them are)

    >>> example = u"Xerox ™ printer"
    >>> example
    u'Xerox \u2122 printer'
    >>> example.encode('ascii')
    Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
    UnicodeEncodeError: 'ascii' codec can't encode character u'\u2122' in position 6: ordinal 
    not in range(128)
    >>> example.encode('ascii', errors='ignore')
    'Xerox  printer'
    >>>
    

    As you can see, when you try to decode the symbol to ascii it raises a UnicodeEncodeError because the character can’t be represented in ascii. However, if you add the errors='ignore' keyword argument then it will simply ignore symbols it can’t encode.

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

Sidebar

Related Questions

I have a specific need to unrar files found in different subdirectories during execution
I am trying to start a process and capture the output, have come a
I have an issue with parsing a date during a unit test run, but
How can I know during parsing which rule is currently matched? I'd like to
During my apprenticeship, I have used NHibernate for some smaller projects which I mostly
I'm in the process of following this process, tested with GHC 7.2.2 for installing
I have CPU bound application that I wish to speedup using multiprocessing+threading instead of
A found an article ( Extend the Visual Studio Build Process ) that explained
Update I want to avoid compiling the templates client-side, and have them compile during
I have a vbscript using the InternetExplorer object to navigate to a few pages

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.