Skip to content

Quickstart

1. Run setup

Before using Hermex for the first time, run setup for the scraper you plan to use. This builds a browser profile that looks like a real user, which significantly reduces bot detection risk.

from hermex import Gemini, ChatGPT

Gemini.setup()   # for Gemini
ChatGPT.setup()  # for ChatGPT

A browser window will open. Browse around for a moment, then close the window. If you need features that require login (e.g. image upload on Gemini), log in during this session — Hermex will reuse the saved session in all future runs.

You only need to do this once. Repeat it if your session expires.

Note

ChatGPT works without login for all features including image upload. For Gemini, guest mode supports basic text queries — image upload requires a logged-in session.

2. Send your first query

The simplest way is simple_query() — it opens the browser, sends your prompt, and closes the browser in one call:

from hermex import Gemini

response = Gemini.simple_query("What is the capital of France?")
print(response.text)

3. Persistent session

For multiple queries in one script, instantiate the scraper directly instead of using simple_query():

from hermex import Gemini

gemini = Gemini()
gemini.open_url()

response = gemini.query("Summarize the history of the internet.")
print(response.text)

response = gemini.query("Now give me just the key dates.")
print(response.text)

gemini.close()

4. Upload an image

from hermex import ChatGPT

chatgpt = ChatGPT()
chatgpt.open_url()

response = chatgpt.query("What's in this image?", images=["photo.jpg"])
print(response.text)

chatgpt.close()

5. Get a generated image

When the response includes a generated image, Hermex downloads it automatically:

response = gemini.query("Generate an image of a mountain at sunset.")
print(response.image)  # Path to the downloaded file

Next steps