lollms-webui/endpoints/docs/lollms_webscraper/DOC.md
2024-08-27 21:58:44 +02:00

1.0 KiB

Here's a concise version of the README.md for LLMs:

# WebScraper.js

A lightweight JavaScript library for web scraping in the browser. Fetch and extract data using CSS selectors.

## Features

- Fetch HTML content from URLs.
- Extract text using CSS selectors.
- Browser-compatible with native JavaScript APIs.

## Usage

Include in HTML:

```html
<script src="/lollms_assets/js/webscraper"></script>

Example:

<script>
    (async () => {
        const scraper = new WebScraper();
        const data = await scraper.scrape('https://example.com', 'h1');
        console.log(data);
    })();
</script>

Notes

  • CORS: Ensure target URLs allow cross-origin requests.
  • Compliance: Follow website terms of service.
  • Dynamic Content: Does not handle JavaScript-rendered content.

Author

By ParisNeo, AI enthusiast.


This version provides a quick overview of the library's purpose, features, usage, and important notes, making it suitable for quick reference or inclusion in a larger document.