Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crawling error in AsyncWebCrawler #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theguy000
Copy link

@theguy000 theguy000 commented Oct 3, 2024

Related to #105

Fix the 'NoneType' object has no attribute 'get' error in AsyncWebCrawler.

  • crawl4ai/async_webcrawler.py

    • Add a check in the arun method to ensure html is not None before further processing.
    • Raise a descriptive error if html is None.
  • crawl4ai/async_crawler_strategy.py

    • Add a check in the crawl method of the AsyncPlaywrightCrawlerStrategy class to handle cases where html is None.
    • Raise a descriptive error if html is None.
  • tests/async/test_basic_crawling.py

    • Add a test case to verify handling of None values for the html variable in the test_invalid_url function.
  • tests/async/test_error_handling.py

    • Add a test case to verify handling of None values for the html variable in the test_network_error function.

For more details, open the Copilot Workspace session.

Related to unclecode#105

Fix the 'NoneType' object has no attribute 'get' error in `AsyncWebCrawler`.

* **crawl4ai/async_webcrawler.py**
  - Add a check in the `arun` method to ensure `html` is not `None` before further processing.
  - Raise a descriptive error if `html` is `None`.

* **crawl4ai/async_crawler_strategy.py**
  - Add a check in the `crawl` method of the `AsyncPlaywrightCrawlerStrategy` class to handle cases where `html` is `None`.
  - Raise a descriptive error if `html` is `None`.

* **tests/async/test_basic_crawling.py**
  - Add a test case to verify handling of `None` values for the `html` variable in the `test_invalid_url` function.

* **tests/async/test_error_handling.py**
  - Add a test case to verify handling of `None` values for the `html` variable in the `test_network_error` function.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/unclecode/crawl4ai/issues/105?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant