handle local stockinformer urls
This commit is contained in:
parent
a0243fab2f
commit
505249bcf4
10
app.py
10
app.py
@ -50,7 +50,13 @@ def get_stockinformer_url(url: str) -> str:
|
|||||||
|
|
||||||
for a in bs.find_all("a"):
|
for a in bs.find_all("a"):
|
||||||
if "view at" in a.text.lower():
|
if "view at" in a.text.lower():
|
||||||
return f"https://stockinformer.co.uk/{a.get('href')}"
|
url = a.get("href")
|
||||||
|
|
||||||
|
if "stockinformer" in url:
|
||||||
|
return f"https://stockinformer.co.uk/{url}"
|
||||||
|
|
||||||
|
return f"{url.split('?')[0]}"
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@ -70,8 +76,6 @@ def get_partalert_url(url: str) -> str:
|
|||||||
|
|
||||||
def check_urls(urls: List[str]):
|
def check_urls(urls: List[str]):
|
||||||
for url in urls:
|
for url in urls:
|
||||||
print(f"Received {url}")
|
|
||||||
|
|
||||||
if "partalert" in url:
|
if "partalert" in url:
|
||||||
url = get_partalert_url(url)
|
url = get_partalert_url(url)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user