From d0c541a31805375f6c4a2858c15aa4b41e41571b Mon Sep 17 00:00:00 2001 From: cid Date: Sat, 23 Dec 2023 23:40:41 +0800 Subject: [PATCH] added csv --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index d5a00a4..80d8e6c 100644 --- a/main.py +++ b/main.py @@ -21,7 +21,7 @@ def scrape_headings(url): # Find all the heading elements (h1, h2, h3, etc.) headings = soup.find_all(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']) - # Extract and print the text from the headings and put to csv using panda + # Extract and print the text from the headings and put to csv heading_list = [heading.text for heading in headings] df = pd.DataFrame(heading_list) df.to_csv('output.csv')