Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to import data to excel
#2
The most simple way would be to write the data to a file named *.CSV (Comma Separated Values). Excel is able to open such files. Then you would have to add a field separator between the values. This field separator is usually a comma but it may also be a semicolon. What Excel really accepts as a field separator is defined in the regional settings of your computer as "List separator".
So you should alter your print statement as follows:
print(h4.a.text.strip() + ',' + tag.attrs['id'])
Reply


Messages In This Thread
How to import data to excel - by jkessous - Jan-23-2020, 09:37 AM
RE: How to import data to excel - by ibreeden - Jan-24-2020, 12:24 PM
RE: How to import data to excel - by snippsat - Jan-24-2020, 04:01 PM
RE: How to import data to excel - by jkessous - Jan-25-2020, 07:45 PM
RE: How to import data to excel - by snippsat - Jan-26-2020, 07:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy data from Excel and paste into Discord (Midjourney) Joe_Wright 4 2,169 Jun-06-2023, 05:49 PM
Last Post: rajeshgk
  Plot a pandas data fram via pyqtgraph with an modul import and qt designer widget Nietzsche 0 879 May-29-2023, 02:42 PM
Last Post: Nietzsche
Video doing data treatment on a file import-parsing a variable EmBeck87 15 3,037 Apr-17-2023, 06:54 PM
Last Post: EmBeck87
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,158 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Python 3.11 data import question love0715 2 846 Mar-05-2023, 06:50 PM
Last Post: snippsat
  Import XML file directly into Excel spreadsheet demdej 0 891 Jan-24-2023, 02:48 PM
Last Post: demdej
  How to properly format rows and columns in excel data from parsed .txt blocks jh67 7 1,978 Dec-12-2022, 08:22 PM
Last Post: jh67
  Trying to Get Arduino sensor data over to excel using Python. eh5713 1 1,771 Dec-01-2022, 01:52 PM
Last Post: deanhystad
  Appending a row of data in an MS Excel file azizrasul 3 1,234 Nov-06-2022, 05:17 PM
Last Post: azizrasul
  Moving data from one Excel to another and finding maximum profit azizrasul 7 1,532 Oct-06-2022, 06:13 PM
Last Post: azizrasul

Forum Jump:

User Panel Messages

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