Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 how to insert list into database
I am storing <p> tag data into list. When i apply insert query then last line of the list stored in the database.
I want to store all data in database that is available in link.
Below is the code of adding <p> tags data into list:

 content_html_container=soup_loop.find('div', class_="template__main")

    for list_p in content:
        for li in p:
#              print(p)
below is the database query:

 news_detail_query="INSERT INTO news_detail (`date`, heading, content, id_authors, id_categories) VALUES (%s, %s, %s, %s, %s)"
    result  = cursor.execute(news_detail_query, insert_news)
list = [X,Y]

INSERT INTO table VALUES ('%s') %s list

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Datas are not insert into database aravinth 1 270 Dec-21-2019, 04:17 PM
Last Post: buran
  Create application that will take information from database and insert into PDF sorrelsj 1 515 Aug-19-2019, 10:08 PM
Last Post: Gribouillis
  Store a python list of lists in a database to use for searches later on klllmmm 3 702 Jun-20-2019, 07:54 AM
Last Post: buran
  Creating a persistent list/database Trinx 1 474 Feb-27-2019, 06:20 PM
Last Post: ichabod801
  Insert list in particular column! Help! vndywarhol 0 743 Sep-17-2018, 11:14 PM
Last Post: vndywarhol
  insert list into sqlite3 mepyyeti 3 6,270 Jan-15-2018, 06:35 AM
Last Post: Gribouillis
  Newbie question for bulk insert into SQL Server database zydjohn 6 8,021 Dec-14-2017, 11:04 PM
Last Post: Larz60+
  Python 3 MySQL database insert error georgian2all 7 3,768 Aug-01-2017, 06:37 PM
Last Post: Larz60+
  Insert using psycopg giving syntax error near "INSERT INTO" olgethorpe 4 6,938 Jul-21-2017, 07:39 PM
Last Post: nilamo

Forum Jump:

Users browsing this thread: 1 Guest(s)