fix: Consolidate import statements in local-files.md for clarity
This commit is contained in:
@@ -8,8 +8,7 @@ To crawl a live web page, provide the URL starting with `http://` or `https://`,
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
import asyncio
|
import asyncio
|
||||||
from crawl4ai import AsyncWebCrawler, CacheMode
|
from crawl4ai import AsyncWebCrawler, CacheMode, CrawlerRunConfig
|
||||||
from crawl4ai.async_configs import CrawlerRunConfig
|
|
||||||
|
|
||||||
async def crawl_web():
|
async def crawl_web():
|
||||||
config = CrawlerRunConfig(cache_mode=CacheMode.BYPASS)
|
config = CrawlerRunConfig(cache_mode=CacheMode.BYPASS)
|
||||||
@@ -33,8 +32,7 @@ To crawl a local HTML file, prefix the file path with `file://`.
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
import asyncio
|
import asyncio
|
||||||
from crawl4ai import AsyncWebCrawler, CacheMode
|
from crawl4ai import AsyncWebCrawler, CacheMode, CrawlerRunConfig
|
||||||
from crawl4ai.async_configs import CrawlerRunConfig
|
|
||||||
|
|
||||||
async def crawl_local_file():
|
async def crawl_local_file():
|
||||||
local_file_path = "/path/to/apple.html" # Replace with your file path
|
local_file_path = "/path/to/apple.html" # Replace with your file path
|
||||||
@@ -93,8 +91,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import asyncio
|
import asyncio
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from crawl4ai import AsyncWebCrawler, CacheMode
|
from crawl4ai import AsyncWebCrawler, CacheMode, CrawlerRunConfig
|
||||||
from crawl4ai.async_configs import CrawlerRunConfig
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
wikipedia_url = "https://en.wikipedia.org/wiki/apple"
|
wikipedia_url = "https://en.wikipedia.org/wiki/apple"
|
||||||
|
|||||||
Reference in New Issue
Block a user