gpt-web-crawler


Namegpt-web-crawler JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryA web crawler for GPTs to build knowledge bases
upload_time2023-12-29 08:39:51
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT License Copyright (c) 2023 Tim Yang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords gpt crawler website knowledge bases ai language models gpt-web-crawler
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
[简体中文](README-Zh.md)    [English](README.md)
## Introduction
GPT-Web-Crawler is a web crawler based on python and puppeteer. It can crawl web pages and extract content (including WebPages' title,url,keywords,description,all text content,all images and screenshot) from web pages. It is very easy to use and can be used to crawl web pages and extract content from web pages in a few lines of code. It is very suitable for people who are not familiar with web crawling and want to use web crawling to extract content from web pages.
![Crawler Working](images/crawler.gif)

The output of the spider can be a json file, which can be easily converted to a csv file, imported into a database or building an AI agent.
![Assistant demo](images/assistant_demo.gif)
## Getting Started
Step1. Install the package.
```bash
pip install gpt-web-crawler
```
Step2. Copy [config_template.py](config_template.py) and rename it to config.py. Then, edit the config.py file to config the openai api key and other settings, if you need use ProSpider to help you extract content from web pages. If you don't need to use ai help you extract content from web pages, **you can keep the config.py file unchanged**.

Step3. Run the following code to start a spider.
```python
from gpt_web_crawler import run_spider,NoobSpider
run_spider(NoobSpider, 
           max_page_count= 10 ,
           start_urls="https://www.jiecang.cn/", 
           output_file = "test_pakages.json",
           extract_rules= r'.*\.html' )
```

## Spiders

| Spider Type | Description                                      |
|-------------|--------------------------------------------------|
| NoobSpider  | Basic web page scraping                          |
| CatSpider   | Web page scraping with screenshots               |
| ProSpider   | Web page scraping with AI-extracted content      |
| LionSpider  | Web page scraping with all images extracted      |

### Cat Spider
Cat spider is a spider that can take screenshots of web pages. It is based on the Noob spider and uses puppeteer to simulate browser operations to take screenshots of the entire web page and save it as an image.
So when you use the Cat spider, you need to install puppeteer first.
```bash
npm install puppeteer
```

## TODO
- [ ] 支持无需配置config.py

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gpt-web-crawler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "gpt,crawler,website,knowledge bases,AI,language models,gpt-web-crawler",
    "author": "",
    "author_email": "Tim Saijun <code@zair.top>",
    "download_url": "https://files.pythonhosted.org/packages/08/f2/5840ca1241368a1075e19e1eb4bb14d55d98815a1ebfeab079fcf3fac9dd/gpt-web-crawler-0.0.2.tar.gz",
    "platform": null,
    "description": "\n[\u7b80\u4f53\u4e2d\u6587](README-Zh.md)    [English](README.md)\n## Introduction\nGPT-Web-Crawler is a web crawler based on python and puppeteer. It can crawl web pages and extract content (including WebPages' title,url,keywords,description,all text content,all images and screenshot) from web pages. It is very easy to use and can be used to crawl web pages and extract content from web pages in a few lines of code. It is very suitable for people who are not familiar with web crawling and want to use web crawling to extract content from web pages.\n![Crawler Working](images/crawler.gif)\n\nThe output of the spider can be a json file, which can be easily converted to a csv file, imported into a database or building an AI agent.\n![Assistant demo](images/assistant_demo.gif)\n## Getting Started\nStep1. Install the package.\n```bash\npip install gpt-web-crawler\n```\nStep2. Copy [config_template.py](config_template.py) and rename it to config.py. Then, edit the config.py file to config the openai api key and other settings, if you need use ProSpider to help you extract content from web pages. If you don't need to use ai help you extract content from web pages, **you can keep the config.py file unchanged**.\n\nStep3. Run the following code to start a spider.\n```python\nfrom gpt_web_crawler import run_spider,NoobSpider\nrun_spider(NoobSpider, \n           max_page_count= 10 ,\n           start_urls=\"https://www.jiecang.cn/\", \n           output_file = \"test_pakages.json\",\n           extract_rules= r'.*\\.html' )\n```\n\n## Spiders\n\n| Spider Type | Description                                      |\n|-------------|--------------------------------------------------|\n| NoobSpider  | Basic web page scraping                          |\n| CatSpider   | Web page scraping with screenshots               |\n| ProSpider   | Web page scraping with AI-extracted content      |\n| LionSpider  | Web page scraping with all images extracted      |\n\n### Cat Spider\nCat spider is a spider that can take screenshots of web pages. It is based on the Noob spider and uses puppeteer to simulate browser operations to take screenshots of the entire web page and save it as an image.\nSo when you use the Cat spider, you need to install puppeteer first.\n```bash\nnpm install puppeteer\n```\n\n## TODO\n- [ ] \u652f\u6301\u65e0\u9700\u914d\u7f6econfig.py\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Tim Yang  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A web crawler for GPTs to build knowledge bases",
    "version": "0.0.2",
    "project_urls": {
        "Documentation": "https://tim-saijun.github.io/gpt-web-crawler/",
        "Homepage": "https://github.com/Tim-Saijun/gpt-web-crawler"
    },
    "split_keywords": [
        "gpt",
        "crawler",
        "website",
        "knowledge bases",
        "ai",
        "language models",
        "gpt-web-crawler"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65aa41830345bd326154fb994b8bce40d20dfa50bc83ece0f612fc259d7ac047",
                "md5": "72d2089f7413b85311753db6327efb4a",
                "sha256": "668bb06722fe917ad74daec9cf21e394b8af7cc428d333d220d941a26fb5cc09"
            },
            "downloads": -1,
            "filename": "gpt_web_crawler-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "72d2089f7413b85311753db6327efb4a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 21777,
            "upload_time": "2023-12-29T08:39:50",
            "upload_time_iso_8601": "2023-12-29T08:39:50.062142Z",
            "url": "https://files.pythonhosted.org/packages/65/aa/41830345bd326154fb994b8bce40d20dfa50bc83ece0f612fc259d7ac047/gpt_web_crawler-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08f25840ca1241368a1075e19e1eb4bb14d55d98815a1ebfeab079fcf3fac9dd",
                "md5": "1f86ed2bccbe337d7421fde190f6f212",
                "sha256": "5df8005ce68ee51a3b74aef8c6e39b08e1fdb329cee3d3b625d301c13767d41f"
            },
            "downloads": -1,
            "filename": "gpt-web-crawler-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1f86ed2bccbe337d7421fde190f6f212",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 16067,
            "upload_time": "2023-12-29T08:39:51",
            "upload_time_iso_8601": "2023-12-29T08:39:51.656088Z",
            "url": "https://files.pythonhosted.org/packages/08/f2/5840ca1241368a1075e19e1eb4bb14d55d98815a1ebfeab079fcf3fac9dd/gpt-web-crawler-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-29 08:39:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Tim-Saijun",
    "github_project": "gpt-web-crawler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gpt-web-crawler"
}
        
Elapsed time: 0.16619s