Open sweep-ai[bot] opened 8 months ago
src/scrape.py
β
Check src/scrape.py with contents:
Ran GitHub Actions for 2b85997cb78bec6a1e902f497ead7720eb967deb:
main.py
β
Check main.py with contents:
Ran GitHub Actions for 4916c57386294e223b85092ec205f82986f02e6c:
Description
This pull request includes changes to the
main.py
andsrc/scrape.py
files. It adds functionality for scraping content from web pages using CSS selectors and XPath.Summary
fetch_page
,parse_page
, andextract_content
functions from thescrape
module inmain.py
.fetch_api_data
function inmain.py
to include optional parameters for scraping.fetch_page
,parse_page
, andextract_content
functions in the newsrc/scrape.py
file.fetch_page
function sends a GET request to a specified URL and returns the response content.parse_page
function parses the HTML content using BeautifulSoup and returns the parsed soup object.extract_content
function extracts content from the parsed soup object using either CSS selectors or XPath, depending on the value of thexpath
parameter.Fixes #6.
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can: