botasaurus-driver


Namebotasaurus-driver JSON
Version 4.0.11 PyPI version JSON
download
home_pageNone
SummarySuper Fast, Super Anti-Detect, and Super Intuitive Web Driver
upload_time2024-05-18 19:52:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.5
licenseMIT License Copyright (c) 2023-2024 Chetan Jain 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 webdriver browser captcha web-scraping selenium navigator python3 cloudflare anti-delect anti-bot bot-detection cloudflare-bypass distil anti-detection
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Botasaurus Driver

Botasaurus Driver is a powerful Driver Automation Python library that offers the following benefits:


- It is indistinguishable from a real browser, allowing it to pass E-V-E-R-Y bot detection challenge.
- Compared to Selenium and Playwright, it is super faster to launch and use.
- The API is designed by and for web scrapers, and you will love it.

## Installation
```bash
pip install botasaurus-driver
```

## Bypassing Bot Detection: Code Example

```python
from botasaurus_driver import Driver

driver = Driver()
driver.google_get("https://www.g2.com/products/github/reviews.html?page=5&product_id=github", bypass_cloudflare=True)
driver.prompt()
heading = driver.get_text('.product-head__title [itemprop="name"]')
print(heading)
```

**Result**

![not blocked](https://raw.githubusercontent.com/omkarcloud/botasaurus/master/images/botasurussuccesspage.png)

## API
Botasaurus Driver provides several handy methods for web automation tasks such as:

- Navigate to URLs:
  ```python
  driver.get("https://www.example.com")
  driver.google_get("https://www.example.com")  # Use Google as the referer [Recommended]
  driver.get_via("https://www.example.com", referer="https://duckduckgo.com/")  # Use custom referer
  driver.get_via_this_page("https://www.example.com")  # Use current page as referer
  ```

- For finding elements:
  ```python
  from botasaurus.browser import Wait
  search_results = driver.select(".search-results", wait=Wait.SHORT)  # Wait for up to 4 seconds for the element to be present, return None if not found
  search_results = driver.wait_for_element(".search-results", wait=Wait.LONG)  # Wait for up to 8 seconds for the element to be present, raise exception if not found
  hello_mom = driver.get_element_with_exact_text("Hello Mom", wait=Wait.VERY_LONG)  # Wait for up to 16 seconds for an element having the exact text "Hello Mom"
  ```

- Interact with elements:
  ```python
  driver.type("input[name='username']", "john_doe")  # Type into an input field
  driver.click("button.submit")  # Clicks an element
  element = driver.select("button.submit")
  element.click()  # Click on an element
  ```

- Retrieve element properties:
  ```python
  header_text = driver.get_text("h1")  # Get text content
  error_message = driver.get_element_containing_text("Error: Invalid input")
  image_url = driver.select("img.logo").get_attribute("src")  # Get attribute value
  ```

- Work with parent-child elements:
  ```python
  parent_element = driver.select(".parent")
  child_element = parent_element.select(".child")
  child_element.click()  # Click child element
  ```

- Execute JavaScript:
  ```python
  result = driver.run_js("return document.title")
  text_content = element.run_js("(el) => el.textContent")
  ```

- Working with iframes:
  ```python
  driver.get("https://www.g2.com/products/github/reviews.html?page=5&product_id=github")
  iframe = driver.select_iframe("#turnstile-wrapper iframe")
  text_content = iframe.select("body label").text
  ```

- Miscellaneous:
  ```python
  form.type("input[name='password']", "secret_password")  # Type into a form field
  container.is_element_present(".button")  # Check element presence
  page_html = driver.page_html  # Current page HTML
  driver.select(".footer").scroll_into_view()  # Scroll element into view
  driver.close()  # Close the browser
  ```

## Love It? [Star It ⭐!](https://github.com/omkarcloud/botasaurus-driver)

Become one of our amazing stargazers by giving us a star ⭐ on GitHub!

It's just one click, but it means the world to me.

[![Stargazers for @omkarcloud/botasaurus-driver](https://bytecrank.com/nastyox/reporoster/php/stargazersSVG.php?user=omkarcloud&repo=botasaurus-driver)](https://github.com/omkarcloud/botasaurus-driver/stargazers)

## Made with ❤️ using [Botasaurus Web Scraping Framework](https://github.com/omkarcloud/botasaurus)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "botasaurus-driver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "Chetan <chetan@omkar.cloud>",
    "keywords": "webdriver, browser, captcha, web-scraping, selenium, navigator, python3, cloudflare, anti-delect, anti-bot, bot-detection, cloudflare-bypass, distil, anti-detection",
    "author": null,
    "author_email": "Chetan <chetan@omkar.cloud>",
    "download_url": "https://files.pythonhosted.org/packages/ef/8f/b7c0e290dcdca4c2e2b5371f026edef64b923cba27c9eda57877b3e6afac/botasaurus_driver-4.0.11.tar.gz",
    "platform": null,
    "description": "# Botasaurus Driver\r\n\r\nBotasaurus Driver is a powerful Driver Automation Python library that offers the following benefits:\r\n\r\n\r\n- It is indistinguishable from a real browser, allowing it to pass E-V-E-R-Y bot detection challenge.\r\n- Compared to Selenium and Playwright, it is super faster to launch and use.\r\n- The API is designed by and for web scrapers, and you will love it.\r\n\r\n## Installation\r\n```bash\r\npip install botasaurus-driver\r\n```\r\n\r\n## Bypassing Bot Detection: Code Example\r\n\r\n```python\r\nfrom botasaurus_driver import Driver\r\n\r\ndriver = Driver()\r\ndriver.google_get(\"https://www.g2.com/products/github/reviews.html?page=5&product_id=github\", bypass_cloudflare=True)\r\ndriver.prompt()\r\nheading = driver.get_text('.product-head__title [itemprop=\"name\"]')\r\nprint(heading)\r\n```\r\n\r\n**Result**\r\n\r\n![not blocked](https://raw.githubusercontent.com/omkarcloud/botasaurus/master/images/botasurussuccesspage.png)\r\n\r\n## API\r\nBotasaurus Driver provides several handy methods for web automation tasks such as:\r\n\r\n- Navigate to URLs:\r\n  ```python\r\n  driver.get(\"https://www.example.com\")\r\n  driver.google_get(\"https://www.example.com\")  # Use Google as the referer [Recommended]\r\n  driver.get_via(\"https://www.example.com\", referer=\"https://duckduckgo.com/\")  # Use custom referer\r\n  driver.get_via_this_page(\"https://www.example.com\")  # Use current page as referer\r\n  ```\r\n\r\n- For finding elements:\r\n  ```python\r\n  from botasaurus.browser import Wait\r\n  search_results = driver.select(\".search-results\", wait=Wait.SHORT)  # Wait for up to 4 seconds for the element to be present, return None if not found\r\n  search_results = driver.wait_for_element(\".search-results\", wait=Wait.LONG)  # Wait for up to 8 seconds for the element to be present, raise exception if not found\r\n  hello_mom = driver.get_element_with_exact_text(\"Hello Mom\", wait=Wait.VERY_LONG)  # Wait for up to 16 seconds for an element having the exact text \"Hello Mom\"\r\n  ```\r\n\r\n- Interact with elements:\r\n  ```python\r\n  driver.type(\"input[name='username']\", \"john_doe\")  # Type into an input field\r\n  driver.click(\"button.submit\")  # Clicks an element\r\n  element = driver.select(\"button.submit\")\r\n  element.click()  # Click on an element\r\n  ```\r\n\r\n- Retrieve element properties:\r\n  ```python\r\n  header_text = driver.get_text(\"h1\")  # Get text content\r\n  error_message = driver.get_element_containing_text(\"Error: Invalid input\")\r\n  image_url = driver.select(\"img.logo\").get_attribute(\"src\")  # Get attribute value\r\n  ```\r\n\r\n- Work with parent-child elements:\r\n  ```python\r\n  parent_element = driver.select(\".parent\")\r\n  child_element = parent_element.select(\".child\")\r\n  child_element.click()  # Click child element\r\n  ```\r\n\r\n- Execute JavaScript:\r\n  ```python\r\n  result = driver.run_js(\"return document.title\")\r\n  text_content = element.run_js(\"(el) => el.textContent\")\r\n  ```\r\n\r\n- Working with iframes:\r\n  ```python\r\n  driver.get(\"https://www.g2.com/products/github/reviews.html?page=5&product_id=github\")\r\n  iframe = driver.select_iframe(\"#turnstile-wrapper iframe\")\r\n  text_content = iframe.select(\"body label\").text\r\n  ```\r\n\r\n- Miscellaneous:\r\n  ```python\r\n  form.type(\"input[name='password']\", \"secret_password\")  # Type into a form field\r\n  container.is_element_present(\".button\")  # Check element presence\r\n  page_html = driver.page_html  # Current page HTML\r\n  driver.select(\".footer\").scroll_into_view()  # Scroll element into view\r\n  driver.close()  # Close the browser\r\n  ```\r\n\r\n## Love It? [Star It \u2b50!](https://github.com/omkarcloud/botasaurus-driver)\r\n\r\nBecome one of our amazing stargazers by giving us a star \u2b50 on GitHub!\r\n\r\nIt's just one click, but it means the world to me.\r\n\r\n[![Stargazers for @omkarcloud/botasaurus-driver](https://bytecrank.com/nastyox/reporoster/php/stargazersSVG.php?user=omkarcloud&repo=botasaurus-driver)](https://github.com/omkarcloud/botasaurus-driver/stargazers)\r\n\r\n## Made with \u2764\ufe0f using [Botasaurus Web Scraping Framework](https://github.com/omkarcloud/botasaurus)\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023-2024 Chetan Jain  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": "Super Fast, Super Anti-Detect, and Super Intuitive Web Driver",
    "version": "4.0.11",
    "project_urls": {
        "Bug Reports": "https://github.com/omkarcloud/botasaurus-driver/issues",
        "Homepage": "https://github.com/omkarcloud/botasaurus-driver",
        "Source": "https://github.com/omkarcloud/botasaurus-driver"
    },
    "split_keywords": [
        "webdriver",
        " browser",
        " captcha",
        " web-scraping",
        " selenium",
        " navigator",
        " python3",
        " cloudflare",
        " anti-delect",
        " anti-bot",
        " bot-detection",
        " cloudflare-bypass",
        " distil",
        " anti-detection"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef8fb7c0e290dcdca4c2e2b5371f026edef64b923cba27c9eda57877b3e6afac",
                "md5": "c90192b5c7375a38845318914a0bb22a",
                "sha256": "51f2828daec12bde6164e7679d63ce7500a9c4bc143824622909033ed392f095"
            },
            "downloads": -1,
            "filename": "botasaurus_driver-4.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "c90192b5c7375a38845318914a0bb22a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 260888,
            "upload_time": "2024-05-18T19:52:50",
            "upload_time_iso_8601": "2024-05-18T19:52:50.327196Z",
            "url": "https://files.pythonhosted.org/packages/ef/8f/b7c0e290dcdca4c2e2b5371f026edef64b923cba27c9eda57877b3e6afac/botasaurus_driver-4.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-18 19:52:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "omkarcloud",
    "github_project": "botasaurus-driver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "botasaurus-driver"
}
        
Elapsed time: 0.26300s