Python Forum
Want to scrape a table data and export it into CSV format
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Want to scrape a table data and export it into CSV format
#4
(Oct-20-2019, 10:33 AM)tahir1990 Wrote: ok got it all clear.But how to export that into CSV file?
Show what you have tried.

If save to a list,then can eg use csv module.
import csv

lst = ['Alabama', 'Alaska', 'Arizona']
with open('filename.csv', 'w') as myfile:
    wr = csv.writer(myfile)
    wr.writerow(lst) 
Output:
Alabama,Alaska,Arizona
Reply


Messages In This Thread
RE: Want to scrape a table data and export it into CSV format - by snippsat - Oct-20-2019, 02:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to scrape data from HTML with no identifiers pythonpaul32 2 856 Dec-02-2023, 03:42 AM
Last Post: pythonpaul32
  I am trying to scrape data to broadcast it on Telegram BarryBoos 1 2,119 Jun-10-2023, 02:36 PM
Last Post: snippsat
  Scrape table from multiple pages Nhattanktnn 1 864 Jun-07-2023, 09:35 AM
Last Post: Larz60+
  How can I target and scrape a data-stat never5000 5 2,817 Feb-11-2022, 07:59 PM
Last Post: snippsat
  Scraping data from table into existing dataframe vincer58 1 2,021 Jan-09-2022, 05:15 PM
Last Post: vincer58
  Python Obstacles | American Kenpo | Wiki Scrape URL/Table and Store it in MariaDB BrandonKastning 6 2,855 Dec-29-2021, 12:38 AM
Last Post: BrandonKastning
  Is it possible to scrape this data from Google Searches rosjo 1 2,201 Nov-06-2020, 06:51 PM
Last Post: Larz60+
  Inserting data from a table to another (in same db) firebird 5 2,498 Oct-05-2020, 06:04 AM
Last Post: buran
  Extract data from a table Bob_M 3 2,686 Aug-14-2020, 03:36 PM
Last Post: Bob_M
  Scraping a dynamic data-table in python through AJAX request filozofo 1 3,887 Aug-14-2020, 10:13 AM
Last Post: kashcode

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020