Skip to content

A Python Module Built Using Rust For Performance Based Data Extraction

Notifications You must be signed in to change notification settings

fahad-programmer/fadex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎯 About

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.

✨ Features

✔️ 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;

Installing

Use the following command in your terminal to install the module.

$ pip install fadex

🚀 Technologies

The following tools were used in this project:

✅ Requirements

Before starting 🏁, ensure you have Python installed.

🧪 How To Use

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))

🛠️ Functionalities

  • 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")

📝 License

This project is licensed under the MIT License. For more details, see the LICENSE file.

Made with ❤️ by Fahad Malik

 

Back to top


About

A Python Module Built Using Rust For Performance Based Data Extraction

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages