souperscraper


Namesouperscraper JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/LucasFaudman/souper-scraper.git
SummaryA simple web scraper base combining Beautiful Soup and Selenium
upload_time2024-06-21 08:26:38
maintainerNone
docs_urlNone
authorLucas Faudman
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Lucas Faudman 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 web-scraping scraping easy beautifulsoup4 beautifulsoup bs4 selenium selenium-webdriver
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SouperScraper

> A simple web scraper base that combines BeautifulSoup and Selenium to scrape dynamic websites.


## Setup
1. Install with pip
```bash
pip install souperscraper
```

2. Download the appropriate [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads) for your Chrome version using [getchromedriver.py](https://github.com/LucasFaudman/souper-scraper/blob/main/src/souperscraper/getchromedriver.py) (command below) or manually from the [ChromeDriver website](https://sites.google.com/a/chromium.org/chromedriver/downloads).
> To find your Chrome version, go to [`chrome://settings/help`](chrome://settings/help) in your browser.
```bash
getchromedriver
```

3. Create a new SouperScaper object using the path to your ChromeDriver
```python
from souperscraper import SouperScraper

scraper = SouperScraper('/path/to/your/chromedriver')
```

4. Start scraping using BeautifulSoup and/or Selenium methods
```python
scraper.goto('https://github.com/LucasFaudman')

# Use BeautifulSoup to search for and extract content
# by accessing the scraper's 'soup' attribute
# or with the 'soup_find' / 'soup_find_all' methods
repos = scraper.soup.find_all('span', class_='repo')
for repo in repos:
    repo_name = repo.text
    print(repo_name)

# Use Selenium to interact with the page such as clicking buttons
# or filling out forms by accessing the scraper's
# find_element_by_* / find_elements_by_* / wait_for_* methods
repos_tab = scraper.find_element_by_css_selector("a[data-tab-item='repositories']")
repos_tab.click()

search_input = scraper.wait_for_visibility_of_element_located_by_id('your-repos-filter')
search_input.send_keys('souper-scraper')
search_input.submit()
```

## BeautifulSoup Reference
- [Quick Start](https://beautiful-soup-4.readthedocs.io/en/latest/#quick-start)
- [Types of Objects](https://beautiful-soup-4.readthedocs.io/en/latest/#kinds-of-objects)
- [The BeautifulSoup object](https://beautiful-soup-4.readthedocs.io/en/latest/#beautifulsoup)
- [Navigating the HTML tree](https://beautiful-soup-4.readthedocs.io/en/latest/#navigating-the-tree)
- [Searching for HTML Elements](https://beautiful-soup-4.readthedocs.io/en/latest/#searching-the-tree)
- [Modifying the tree](https://beautiful-soup-4.readthedocs.io/en/latest/#modifying-the-tree)

## Selenium Reference
- [Quick Start](https://selenium-python.readthedocs.io/getting-started.html)
- [Navigating the Web](https://selenium-python.readthedocs.io/getting-started.html#)
- [Locating HTML Elements](https://selenium-python.readthedocs.io/locating-elements.html)
- [Interacting with HTML elements on the page](https://selenium-python.readthedocs.io/navigating.html#interacting-with-the-page)
- [Filling in Forms](https://selenium-python.readthedocs.io/navigating.html#filling-in-forms)
- [Waiting (for page to load, element to be visible, etc)](https://selenium-python.readthedocs.io/waits.html)
- [Full Webdriver API Reference](https://selenium-python.readthedocs.io/api.html)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/LucasFaudman/souper-scraper.git",
    "name": "souperscraper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "web-scraping, scraping, easy, beautifulsoup4, beautifulsoup, bs4, selenium, selenium-webdriver",
    "author": "Lucas Faudman",
    "author_email": "Lucas Faudman <lucasfaudman@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c9/de/acfd39573076b58ce43fe2681a0ac16c8f1f83812b66cebd4607195b0d17/souperscraper-1.0.1.tar.gz",
    "platform": null,
    "description": "# SouperScraper\n\n> A simple web scraper base that combines BeautifulSoup and Selenium to scrape dynamic websites.\n\n\n## Setup\n1. Install with pip\n```bash\npip install souperscraper\n```\n\n2. Download the appropriate [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads) for your Chrome version using [getchromedriver.py](https://github.com/LucasFaudman/souper-scraper/blob/main/src/souperscraper/getchromedriver.py) (command below) or manually from the [ChromeDriver website](https://sites.google.com/a/chromium.org/chromedriver/downloads).\n> To find your Chrome version, go to [`chrome://settings/help`](chrome://settings/help) in your browser.\n```bash\ngetchromedriver\n```\n\n3. Create a new SouperScaper object using the path to your ChromeDriver\n```python\nfrom souperscraper import SouperScraper\n\nscraper = SouperScraper('/path/to/your/chromedriver')\n```\n\n4. Start scraping using BeautifulSoup and/or Selenium methods\n```python\nscraper.goto('https://github.com/LucasFaudman')\n\n# Use BeautifulSoup to search for and extract content\n# by accessing the scraper's 'soup' attribute\n# or with the 'soup_find' / 'soup_find_all' methods\nrepos = scraper.soup.find_all('span', class_='repo')\nfor repo in repos:\n    repo_name = repo.text\n    print(repo_name)\n\n# Use Selenium to interact with the page such as clicking buttons\n# or filling out forms by accessing the scraper's\n# find_element_by_* / find_elements_by_* / wait_for_* methods\nrepos_tab = scraper.find_element_by_css_selector(\"a[data-tab-item='repositories']\")\nrepos_tab.click()\n\nsearch_input = scraper.wait_for_visibility_of_element_located_by_id('your-repos-filter')\nsearch_input.send_keys('souper-scraper')\nsearch_input.submit()\n```\n\n## BeautifulSoup Reference\n- [Quick Start](https://beautiful-soup-4.readthedocs.io/en/latest/#quick-start)\n- [Types of Objects](https://beautiful-soup-4.readthedocs.io/en/latest/#kinds-of-objects)\n- [The BeautifulSoup object](https://beautiful-soup-4.readthedocs.io/en/latest/#beautifulsoup)\n- [Navigating the HTML tree](https://beautiful-soup-4.readthedocs.io/en/latest/#navigating-the-tree)\n- [Searching for HTML Elements](https://beautiful-soup-4.readthedocs.io/en/latest/#searching-the-tree)\n- [Modifying the tree](https://beautiful-soup-4.readthedocs.io/en/latest/#modifying-the-tree)\n\n## Selenium Reference\n- [Quick Start](https://selenium-python.readthedocs.io/getting-started.html)\n- [Navigating the Web](https://selenium-python.readthedocs.io/getting-started.html#)\n- [Locating HTML Elements](https://selenium-python.readthedocs.io/locating-elements.html)\n- [Interacting with HTML elements on the page](https://selenium-python.readthedocs.io/navigating.html#interacting-with-the-page)\n- [Filling in Forms](https://selenium-python.readthedocs.io/navigating.html#filling-in-forms)\n- [Waiting (for page to load, element to be visible, etc)](https://selenium-python.readthedocs.io/waits.html)\n- [Full Webdriver API Reference](https://selenium-python.readthedocs.io/api.html)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Lucas Faudman  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 simple web scraper base combining Beautiful Soup and Selenium",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/LucasFaudman/souper-scraper.git",
        "Repository": "https://github.com/LucasFaudman/souper-scraper.git"
    },
    "split_keywords": [
        "web-scraping",
        " scraping",
        " easy",
        " beautifulsoup4",
        " beautifulsoup",
        " bs4",
        " selenium",
        " selenium-webdriver"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59153a54351a08107955aa0d09b8acad4777431413e0f082b96f3491d7b3edb0",
                "md5": "97001d440a32ba756d8bb1e9b019df0f",
                "sha256": "6b06c0736b703555244fc3d142a3f3ecf62de2e95416e3c1917b973743b09c2c"
            },
            "downloads": -1,
            "filename": "souperscraper-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "97001d440a32ba756d8bb1e9b019df0f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11604,
            "upload_time": "2024-06-21T08:26:37",
            "upload_time_iso_8601": "2024-06-21T08:26:37.127030Z",
            "url": "https://files.pythonhosted.org/packages/59/15/3a54351a08107955aa0d09b8acad4777431413e0f082b96f3491d7b3edb0/souperscraper-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9deacfd39573076b58ce43fe2681a0ac16c8f1f83812b66cebd4607195b0d17",
                "md5": "5a9f250b059a708f285fa0a5a5440bb1",
                "sha256": "c8411375020fc87041946dc89e823188d9795e5ea87fc470bc10e7026a085a9b"
            },
            "downloads": -1,
            "filename": "souperscraper-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5a9f250b059a708f285fa0a5a5440bb1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16764,
            "upload_time": "2024-06-21T08:26:38",
            "upload_time_iso_8601": "2024-06-21T08:26:38.876313Z",
            "url": "https://files.pythonhosted.org/packages/c9/de/acfd39573076b58ce43fe2681a0ac16c8f1f83812b66cebd4607195b0d17/souperscraper-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-21 08:26:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "LucasFaudman",
    "github_project": "souper-scraper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "souperscraper"
}
        
Elapsed time: 0.27956s