Arafath10 commited on
Commit
ef24fee
·
verified ·
1 Parent(s): faea8d5

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -12
main.py CHANGED
@@ -22,18 +22,9 @@ import time
22
 
23
  @app.get("/get_scraped_data")
24
  async def get_data(url: str):
25
- # Start time
26
- start_time = time.time()
27
- #try:
28
  data = await Scraper.scrape(url)
29
- # End time
30
- end_time = time.time()
31
-
32
- # Calculate the elapsed time
33
- elapsed_time = end_time - start_time
34
-
35
- print(f"Time taken for the process: {elapsed_time:.2f} seconds")
36
  return data
37
- #except Exception as e:
38
- #raise HTTPException(status_code=500, detail=str(e))
39
 
 
22
 
23
  @app.get("/get_scraped_data")
24
  async def get_data(url: str):
25
+ try:
 
 
26
  data = await Scraper.scrape(url)
 
 
 
 
 
 
 
27
  return data
28
+ except:
29
+ return {"title": "error", "URL": url, "Content": "none"}
30