crawl-to-markdown
Version:
Crawl-to-markdown is a powerful TypeScript package designed to search search engines for a given keyword, crawl the resulting websites, and deliver the content in clean, readable Markdown format. Additionally, it can directly crawl specified websites for
82 lines (50 loc) • 2.25 kB
Markdown
**Crawl-to-Markdown** is a TypeScript package designed to search search engines for a given keyword, crawl the resulting websites, and return their content in Markdown format. It can also directly crawl specified websites, making it a versatile tool for content extraction, documentation, or SEO analysis.
- Search search engines for keywords and crawl the results.
- Crawl websites directly by providing URLs.
- Extract web content and deliver it in markdown format.
- Ideal for developers, content creators, and SEO specialists.
- Built-in support for structured data extraction.
Install the package via npm:
```bash
npm install crawl-to-markdown
```
You can provide a keyword, and the package will search the web and crawl the top results, returning the content in markdown format:
```typescript
import { MarkdownCrawler } from 'crawl-to-markdown';
const keyword = 'How to outperform your self';
const crawler = new MarkdownCrawler(true);
const result = await crawler.crawlFromKeyword(keyword, 'google');
```
If you want to crawl a specific website and extract its content:
```typescript
import { MarkdownCrawler } from 'crawl-to-markdown';
const url = 'https://example.com';
const crawler = new MarkdownCrawler(true);
const result = await crawler.crawlFromUrl(url);
```
- **keyword**: A keyword to search in search engines.
- Returns a promise that resolves to the markdown content extracted from the top search results.
- **url**: A specific website URL to crawl.
- Returns a promise that resolves to the markdown content of the crawled webpage.
Here’s an example of what the markdown output might look like:
```markdown
This is an example content scraped from the website.
Details about the first section...
Final thoughts and summary...
```
This project is licensed under the MIT License. See the `LICENSE` file for more details.