update text
Browse files
app.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
-
from fastapi import FastAPI
|
| 2 |
from bs4 import BeautifulSoup
|
| 3 |
import time
|
| 4 |
import requests
|
| 5 |
from fastapi.responses import HTMLResponse
|
| 6 |
from starlette.responses import FileResponse
|
| 7 |
-
from fastapi.templating import Jinja2Templates
|
| 8 |
|
| 9 |
app = FastAPI(
|
| 10 |
title="PSX web scraper",
|
|
@@ -12,8 +11,6 @@ app = FastAPI(
|
|
| 12 |
description="Scrape data from PSX website"
|
| 13 |
)
|
| 14 |
|
| 15 |
-
templates = Jinja2Templates(directory="templates")
|
| 16 |
-
|
| 17 |
|
| 18 |
def simple_dividend_extraction():
|
| 19 |
"""
|
|
@@ -80,12 +77,10 @@ def greet_json():
|
|
| 80 |
def get_dividend():
|
| 81 |
return simple_dividend_extraction()
|
| 82 |
|
| 83 |
-
@app.get("/PrivacyPolicy"
|
| 84 |
-
async def get_privacy_policy(
|
| 85 |
|
| 86 |
-
return
|
| 87 |
-
request=request, name="text.html"
|
| 88 |
-
)
|
| 89 |
|
| 90 |
|
| 91 |
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
from bs4 import BeautifulSoup
|
| 3 |
import time
|
| 4 |
import requests
|
| 5 |
from fastapi.responses import HTMLResponse
|
| 6 |
from starlette.responses import FileResponse
|
|
|
|
| 7 |
|
| 8 |
app = FastAPI(
|
| 9 |
title="PSX web scraper",
|
|
|
|
| 11 |
description="Scrape data from PSX website"
|
| 12 |
)
|
| 13 |
|
|
|
|
|
|
|
| 14 |
|
| 15 |
def simple_dividend_extraction():
|
| 16 |
"""
|
|
|
|
| 77 |
def get_dividend():
|
| 78 |
return simple_dividend_extraction()
|
| 79 |
|
| 80 |
+
@app.get("/PrivacyPolicy")
|
| 81 |
+
async def get_privacy_policy():
|
| 82 |
|
| 83 |
+
return FileResponse('text.html')
|
|
|
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
|