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

  • Home
  • SEARCH
  • 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 7249001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:13:21+00:00 2026-05-28T22:13:21+00:00

I want to convert a list object into a string and insert this string

  • 0

I want to convert a list object into a string and insert this string as one row in mysql database. Can someone please provide a solution to this. My code looks like this:

def parse(self, response):
    hxs = HtmlXPathSelector(response)
    sites = hxs.select('//ul/li')
    for site in sites:
         con = mysqldb.connect(
                    host="localhost",
                    user="dreamriks",
                    passwd="dreamriks",
                    db="scraped_data"
                 )
         cur = con.cursor()
         quest = site.select('//h2').extract()
         ans = site.select('//h3').extract()
         meta = site.select('//meta').extract()
         cur.execute("""Insert into scraped_data(h2, h3, meta) Values(%s,%s,%s)""",(quest,ans,meta))                   
         con.commit()
         con.close()

The code above gives the following error:

File "/usr/local/lib/python2.7/dist-packages/Scrapy-0.14.0.2841-py2.7.egg/scrapy/spider.py", line 62, in parse
        raise NotImplementedError
    exceptions.NotImplementedError:

Can someone help me with this error. I am stuck at 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-05-28T22:13:23+00:00Added an answer on May 28, 2026 at 10:13 pm

    Not sure where your list is in the sample code, but you create a string from a list using join:

    l = ['The','quick','brown','fox']
    s = ''.join(l)
    print(s)
    

    gives:

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

Sidebar

Related Questions

If I have something like a List[Option[A]] and I want to convert this into
The short story: I want to convert a list/dictionary into an anonymous object Basically
I want to convert a List (of Long) into a string array. Reason: it's
I want to convert a list like this l1 = [1,2,3,4,5,6,7,8] to l2 =
I want to convert a primitive to a string, and I tried: myInt.toString(); This
I want to convert a string into a double and after doing some math
I have a list of NHibernate.Expression.Order objects and want to convert them into a
I have a DataSet and I want to convert the DataSet into List<T> T
I want to convert a List to a List so that each object on
How can I convert this text file content into a recursive collection of objects

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.