Fadex is a powerful Python module that provides robust web scraping functionalities, including fetching web pages, extracting metadata, and parsing HTML content. Built with a Rust backend using PyO3, it is optimized for performance and ease of use in web scraping tasks.
✔️ Fetch web pages asynchronously;
✔️ Extract metadata including title and description;
✔️ Sanitize and extract all href links from HTML;
✔️ Fetch elements by ID and class efficiently;
Use the following command in your terminal to install the module.
$ pip install fadex
The following tools were used in this project:
Before starting 🏁, ensure you have Python installed.
import asyncio
from fadex import fetch_page_py
async def fetch_page(url):
try:
content = await fetch_page_py(url)
print("Page content fetched successfully:")
print(content)
except Exception as e:
print(f"Failed to fetch page: {e}")
# Example usage
url = "http://example.com"
asyncio.run(fetch_page(url))
-
Fetch metadata (title and description):
title, description = get_meta_and_title(html_content)
-
Extract links from HTML:
links = extract_links(html_content)
-
Fetch elements by ID:
elements = find_element_by_id(html_content, "your-id")
-
Fetch elements by class:
elements = get_elements_by_cls(html_content, "your-class")
This project is licensed under the MIT License. For more details, see the LICENSE file.
Made with ❤️ by Fahad Malik