项目介绍

kaymen99/ai-web-scraper 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,目前获得 85 个 Star、19 次 Fork。

仓库全名
kaymen99/ai-web-scraper
Star 数
85
Fork 数
19

README 摘要

AI Web Scraper with Crawl4AI 👉 Learn How to Scrape and Build Lead Lists Easily with Crawl4AI! This project is an AI-powered web scraper built with Crawl4AI. It automates lead generation by extracting local business (Dentists, restaurents,...) names, addresses, phone numbers, and more from YellowPages. With the help of LLMs like GPT-4o, Claude, and DeepSeek, it intelligently processes data and saves it in CSV files,…

完整内容见 GitHub 原始 README 或本页 。

常见问题

ai-web-scraper 用什么语言开发?

主要使用 Python 编写,目前有 85 个 Star。

如何获取 ai-web-scraper 的源码?

可以直接克隆仓库:git clone https://github.com/kaymen99/ai-web-scraper.git,默认分支为 main;安装与运行步骤见仓库 README。

ai-web-scraper 最近还在维护吗?

仓库最近一次更新为 2025年2月13日,当前没有未关闭的 Issue;Star 数为 85,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

AI web scraper built with Crawl4AI for extracting structured leads data from websites.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
125
价值分
56
活跃状态
活跃

语言占比

Python

贡献者

README

AI Web Scraper with Crawl4AI

👉 Learn How to Scrape and Build Lead Lists Easily with Crawl4AI!

This project is an AI-powered web scraper built with Crawl4AI. It automates lead generation by extracting local business (Dentists, restaurents,…) names, addresses, phone numbers, and more from YellowPages. With the help of LLMs like GPT-4o, Claude, and DeepSeek, it intelligently processes data and saves it in CSV files, making it ready for outreach or analysis!

Features

  • Extract Business Information – Scrape business names, contact details, and other key data.
  • AI-Powered Data Processing – Use LLMs to clean, format, and enhance the extracted data.
  • Customizable Scraper – Adapt it to different websites and data types.
  • Flexible LLM Integration – Choose from AI models like GPT-4, Claude, and DeepSeek.

Adaptability

This scraper is designed for YellowPages but can be used on any website. You can change the target URL, modify the AI instructions to adjust how the data is processed, and define new data fields based on your needs.

Potential Use Cases

  • Lead Generation – Collect business emails, phone numbers, and addresses to build targeted outreach lists.
  • Market Research – Gather real-time industry data to analyze trends and customer behavior.
  • Competitor Analysis – Monitor pricing, services, and customer reviews to stay competitive.
  • AI Data Enrichment – Use LLMs to clean and categorize data for better insights.
  • Research & Analysis – Extract structured data from directories, reports, and other sources for business or academic studies.

Project Structure

.
├── main.py # Main entry point for the crawler
├── config.py # Contains configuration constants (LLM Models, Base URL, CSS selectors, etc.)
├── models
│ └── business.py # Defines the Local Business data model using Pydantic
├── src
│ ├── utils.py # Utility functions for processing and saving data
│ └── scraper.py # functions for configuring and running the crawler
└── requirements.txt # Python package dependencies

How to Run

Prerequisites

Ensure you have the following installed:

  • Python 3.11+
  • LLM provider API key (OpenAI, Gemini, Claude,…)
  • Necessary Python libraries (listed in requirements.txt)

Setup

Clone the Repository

git clone https://github.com/kaymen99/llm-web-scraper
cd llm-web-scraper

Create and Activate a Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

Install Required Packages

pip install -r requirements.txt
playwright install

Set Up Environment Variables

Create a .env file in the root directory and add necessary credentials:

# API keys for LLMs providers, add key for every provider you want to use
OPENAI_API_KEY=""            # OpenAI API key for accessing OpenAI's models and services
GEMINI_API_KEY=""            # Google Cloud API key for accessing Google Cloud services
GROQ_API_KEY=""              # GROQ platform API key for using GROQ's services

Running the scraper

To start the scraper, run:

python main.py

The script will crawl the specified website, extract data page by page, and save the complete venues to a businesses_data.csv file in the project directory. Additionally, usage statistics for the LLM strategy will be displayed after crawling.

Configuration

The config.py file contains key settings for controlling the scraper’s behavior. You can modify these values to customize the scraping process:

  • LLM_MODEL: The AI model used for data extraction. Supports any LLM from LiteLLM (e.g., gpt-4o, claude, deepseek-chat, gemini-2.0-flash).
  • BASE_URL: The target website to scrape. By default, it extracts dentists in Toronto from Yellow Pages, but you can change this to any business category or location.
  • CSS_SELECTOR: The HTML selector used to pinpoint business details within the page.
  • MAX_PAGES: Limits the number of pages to crawl (default: 3). Increase this value to scrape more data.
  • SCRAPER_INSTRUCTIONS: Custom LLM prompt defining what details to extract .

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

Contact

If you have any questions or suggestions, feel free to contact me at [email protected].

评论

暂无评论