Skip to content

Gemini

Gemini targets gemini.google.com. All methods shared with ChatGPT are documented on the Shared Interface page — this page covers only what is specific to Gemini.


Guest mode vs logged-in mode

Gemini works in two modes depending on whether you are logged in:

Feature Without login Logged in
Text queries
File upload
Image generation
Watermark removal

Attempting file upload without a logged-in session raises LoginRequiredError. Run Gemini.setup() and log in to enable it.


Supported attachments

Gemini.SUPPORTED_ATTACHMENTS is the set of file extensions accepted for upload. Passing any other extension to send_message() or query() raises a ValueError before touching the browser.

print(Gemini.SUPPORTED_ATTACHMENTS)
# {'.png', '.jpg', '.jpeg', '.gif', '.webp', '.pdf', '.csv', '.txt', '.json'}

hermex.gemini.Gemini

Bases: Scraper

Scraper for Google Gemini (gemini.google.com).

Supports text queries, file uploads, and downloading generated images. Works in guest mode for basic text queries; file upload requires a logged-in session established via Gemini.setup().

Generated images are optionally post-processed to remove the Gemini watermark via remove_watermark=True on query() or get_last_response().

SUPPORTED_ATTACHMENTS = {'.png', '.jpg', '.jpeg', '.gif', '.webp', '.pdf', '.csv', '.txt', '.json'} class-attribute instance-attribute


Watermark removal

Gemini watermarks its generated images. Pass remove_watermark=True to query() or get_last_response() to strip it automatically using OpenCV template matching — no external service involved.

response = gemini.query("Generate an image of a sunset.", remove_watermark=True)

Default URL

open_url() defaults to https://gemini.google.com and raises ValueError if a non-Gemini URL is passed.