From a6269395a8c2b02c3cbda92055a3b39d64cdda82 Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Mon, 18 Nov 2024 14:28:32 +0100 Subject: [PATCH] removed unused files --- extract_data.py | 27 --------------------------- extracted_data.py | 28 ---------------------------- 2 files changed, 55 deletions(-) delete mode 100644 extract_data.py delete mode 100644 extracted_data.py diff --git a/extract_data.py b/extract_data.py deleted file mode 100644 index df3babc2..00000000 --- a/extract_data.py +++ /dev/null @@ -1,27 +0,0 @@ -def extract_data(html: str) -> dict: - from bs4 import BeautifulSoup - - # Parse the HTML content using BeautifulSoup - soup = BeautifulSoup(html, 'html.parser') - - # Initialize an empty list to hold project data - projects = [] - - # Find all project entries in the HTML - project_entries = soup.find_all('div', class_='grid-item') - - # Iterate over each project entry to extract title and description - for entry in project_entries: - # Extract the title from the h4 element - title = entry.find('h4', class_='card-title').get_text(strip=True) - # Extract the description from the p element - description = entry.find('p', class_='card-text').get_text(strip=True) - - # Append the extracted data as a dictionary to the projects list - projects.append({ - 'title': title, - 'description': description - }) - - # Return the structured data as a dictionary matching the desired JSON schema - return {'projects': projects} \ No newline at end of file diff --git a/extracted_data.py b/extracted_data.py deleted file mode 100644 index 45da5e49..00000000 --- a/extracted_data.py +++ /dev/null @@ -1,28 +0,0 @@ -def extract_data(html: str) -> dict: - from bs4 import BeautifulSoup - - # Parse the HTML content using BeautifulSoup - soup = BeautifulSoup(html, 'html.parser') - - # Initialize an empty list to hold project data - projects = [] - - # Find all project entries in the HTML - project_entries = soup.find_all('div', class_='grid-item') - - # Iterate over each project entry to extract title and description - for entry in project_entries: - # Extract the title from the card-title class - title = entry.find('h4', class_='card-title').get_text(strip=True) - - # Extract the description from the card-text class - description = entry.find('p', class_='card-text').get_text(strip=True) - - # Append the extracted data as a dictionary to the projects list - projects.append({ - 'title': title, - 'description': description - }) - - # Return the structured data as a dictionary matching the desired JSON schema - return {'projects': projects} \ No newline at end of file