Merge branch 'main' of https://github.com/unclecode/crawl4ai
This commit is contained in:
@@ -23,13 +23,14 @@ class AsyncWebCrawler:
|
|||||||
self,
|
self,
|
||||||
crawler_strategy: Optional[AsyncCrawlerStrategy] = None,
|
crawler_strategy: Optional[AsyncCrawlerStrategy] = None,
|
||||||
always_by_pass_cache: bool = False,
|
always_by_pass_cache: bool = False,
|
||||||
|
base_directory: str = str(Path.home()),
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
self.crawler_strategy = crawler_strategy or AsyncPlaywrightCrawlerStrategy(
|
self.crawler_strategy = crawler_strategy or AsyncPlaywrightCrawlerStrategy(
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
self.always_by_pass_cache = always_by_pass_cache
|
self.always_by_pass_cache = always_by_pass_cache
|
||||||
self.crawl4ai_folder = os.path.join(Path.home(), ".crawl4ai")
|
self.crawl4ai_folder = os.path.join(base_directory, ".crawl4ai")
|
||||||
os.makedirs(self.crawl4ai_folder, exist_ok=True)
|
os.makedirs(self.crawl4ai_folder, exist_ok=True)
|
||||||
os.makedirs(f"{self.crawl4ai_folder}/cache", exist_ok=True)
|
os.makedirs(f"{self.crawl4ai_folder}/cache", exist_ok=True)
|
||||||
self.ready = False
|
self.ready = False
|
||||||
|
|||||||
Reference in New Issue
Block a user