Switch to ChromeDriverManager due some issues with download the chrome driver

This commit is contained in:
unclecode
2024-06-26 13:00:17 +08:00
parent a0dff192ae
commit 144cfa0eda
3 changed files with 15 additions and 4 deletions

View File

@@ -49,7 +49,9 @@ templates = Jinja2Templates(directory=__location__ + "/pages")
@lru_cache()
def get_crawler():
# Initialize and return a WebCrawler instance
return WebCrawler(verbose = True)
crawler = WebCrawler(verbose = True)
crawler.warmup()
return crawler
class CrawlRequest(BaseModel):
urls: List[str]