from fastapi import FastAPI, HTTPException, Query import httpx import re app = FastAPI() @app.get("/") def read_root(): return {"message": "FastAPI is running"} @app.get("/fetch-url/") async def fetch_url(url: str = Query(..., description="The URL to fetch")): async with httpx.AsyncClient() as client: try: response = await client.get(url) response.raise_for_status() # Check if the request was successful content = response.text price = '$' + re.findall('mainPrice__tM6aY">