faster api response
Browse files- requirements.txt +3 -1
- ticker_detail.py +2 -1
requirements.txt
CHANGED
|
@@ -5,4 +5,6 @@ beautifulsoup4
|
|
| 5 |
jinja2
|
| 6 |
pydantic
|
| 7 |
pytz
|
| 8 |
-
firebase-admin
|
|
|
|
|
|
|
|
|
| 5 |
jinja2
|
| 6 |
pydantic
|
| 7 |
pytz
|
| 8 |
+
firebase-admin
|
| 9 |
+
lxml
|
| 10 |
+
httpx
|
ticker_detail.py
CHANGED
|
@@ -4,6 +4,7 @@ from datetime import datetime
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from models import TickerData,Ticker
|
| 6 |
import re
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
class PSXScraper:
|
|
@@ -25,7 +26,7 @@ class PSXScraper:
|
|
| 25 |
def fetch(self):
|
| 26 |
response = requests.get(self.url, headers=self.headers)
|
| 27 |
response.raise_for_status()
|
| 28 |
-
self.soup = BeautifulSoup(response.text, "
|
| 29 |
|
| 30 |
# ---------------------------
|
| 31 |
# Parse Top Price Section
|
|
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from models import TickerData,Ticker
|
| 6 |
import re
|
| 7 |
+
import httpx
|
| 8 |
|
| 9 |
|
| 10 |
class PSXScraper:
|
|
|
|
| 26 |
def fetch(self):
|
| 27 |
response = requests.get(self.url, headers=self.headers)
|
| 28 |
response.raise_for_status()
|
| 29 |
+
self.soup = BeautifulSoup(response.text, "lxml")
|
| 30 |
|
| 31 |
# ---------------------------
|
| 32 |
# Parse Top Price Section
|