Skip to content

Unable to fetch page with JavaScript despite success status #1475

@ceilingfans

Description

@ceilingfans

Environment details

  • Programming language: Python
  • OS: macOS
  • Language runtime version: 3.13.7
  • Package version: google-genai 1.40.0

Steps to reproduce

  1. Use UrlContext tool to fetch a page that requires JavaScript
  2. Receive a UrlRetrievalStatus.URL_RETRIEVAL_STATUS_SUCCESS in the UrlMetadata

Sample Code

from google import genai
from google.genai.types import (
    Tool,
    GenerateContentConfig,
    UrlContext,
    GoogleSearch,
)
from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv())

client = genai.Client()
model_id = "gemini-2.5-flash-preview-09-2025"

tools = []
tools.append(Tool(url_context=UrlContext()))
tools.append(Tool(google_search=GoogleSearch()))

response = client.models.generate_content(
    model=model_id,
    contents="https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-59489\nBased on this article, what is the CVSS v3.1 base score? If you cannot access the article, respond with 'No Access'.",
    config=GenerateContentConfig(
        tools=tools,
        response_modalities=["TEXT"],
    ),
)

for each in response.candidates[0].content.parts:
    print(each.text)
# get URLs retrieved for context
print(response.candidates[0].url_context_metadata)

# Response:
# I cannot access the content of the specific article linked.
#
# No Access
# None

Suggestion

It would be good if the status was not success, maybe another status such as Blocked or JavaScript Required would be nice.

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions