{"record":{"id":"c4eb2a78eb167df7","repo":"xtekky/gpt4free","slug":"no-images-found","errorCode":null,"errorMessage":"No images found","messagePattern":"No images found","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"g4f/Provider/needs_auth/bing/create_images.py","lineNumber":163,"sourceCode":"def read_images(html_content: str) -> List[str]:\n    \"\"\"\n    Extracts image URLs from the HTML content.\n\n    Args:\n        html_content (str): HTML content containing image URLs.\n\n    Returns:\n        List[str]: A list of image URLs.\n    \"\"\"\n    soup = BeautifulSoup(html_content, \"html.parser\")\n    tags = soup.find_all(\"img\", class_=\"mimg\")\n    if not tags:\n        tags = soup.find_all(\"img\", class_=\"gir_mmimg\")\n    images = [img[\"src\"].split(\"?w=\")[0] for img in tags]\n    if any(im in BAD_IMAGES for im in images):\n        raise RuntimeError(\"Bad images found\")\n    if not images:\n        raise RuntimeError(\"No images found\")\n    return images\n","sourceCodeStart":145,"sourceCodeEnd":165,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/needs_auth/bing/create_images.py#L145-L165","documentation":"Raised by read_images() when BeautifulSoup finds no <img> tags with class \"mimg\" (or the fallback class \"gir_mmimg\") in the Bing results HTML, producing an empty image list. It means the polling loop ended with a page that looks complete but contains no result markup — typically a layout change or an empty/silent failure page from Bing.","triggerScenarios":"Bing returns an HTML results page without mimg/gir_mmimg img elements — e.g. after a frontend markup change, an A/B variant, or an error page that lacks the GenerativeImagesStatusPage marker the polling loop checks for.","commonSituations":"Outdated g4f version after Bing ships a markup redesign; regional Bing variants serving different DOM; responses that are JSON errors not matching the errorMessage checks.","solutions":["Update g4f to the latest version — selector breakage against Bing's markup is fixed upstream","Log/dump the returned HTML to confirm which page Bing actually served","Retry — transient empty responses occur under load","Switch to another image provider if Bing markup has changed and no fix is released yet"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    images = await create_images(client, prompt)\nexcept RuntimeError as e:\n    if \"No images found\" in str(e):\n        images = await other_image_provider(prompt)  # markup drift, not your fault\n    else:\n        raise","preventionTips":["Pin a known-good g4f version rather than a stale one when relying on scraped HTML","Update g4f promptly when Bing ships frontend changes","Keep a secondary image provider configured for automatic fallback"],"tags":["bing","image-generation","parsing","scraper-drift"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}