Read other web pages in a prompt with {{page}}
Pull text from other pages into a prompt with the {{page}} parameter.
On this page
{{page}} is the text of the page you're on. Give it a URL and it reads another page instead, without opening it in a
tab: that turns any prompt or command into a small crawler.
# The options
Options go inside the brackets after page, in any order:
{{page query url limit=20% type=render timeout=5000}}
| Option | What it does |
|---|---|
url | Reads this page instead of the open one. Starts with https:// or http:// |
query | Any other words. If the text doesn't fit, HARPA keeps the passages closest to them |
limit=500 | At most 500 tokens of the page |
limit=10% | At most 10% of the model's context window |
type=render | Default. Loads the page in a hidden frame, so content drawn by JavaScript is read too |
type=fetch | Downloads the page's text only: faster, but misses content drawn by JavaScript |
type=html | Downloads the raw HTML |
timeout=5000 | How long to wait for the page, in milliseconds (5000 by default) |
For example, this reads the Northwind returns page and keeps the 10% of the context that is most about refunds:
{{page refund policy https://northwind.com/help/returns limit=10%}}
The full list of parameters is in Parameters.
# Fetch or navigate
{{page url}}is quick and needs no tab. It works on most sites, but not on sites that block it.- A Navigate step opens the page in a tab, like you would. It is slower, but it works on any site you can open, and a Loop can go over a list of links: see Navigate.
Try {{page url}} first; switch to navigating if the text comes back empty or says Failed fetching URL.
# Example: answer questions from a website
This command searches one site, reads the top results and answers from them, with links.
- Type / in the chat and click Create.
- Add an Ask step that saves the question in
{{query}}. - Add a Calc step, Set parameter, that saves
{{serp {{query}} site:northwind.com}}in{{data}}. - Add a Calc step, Extract SERP links, from
datatolinks. Each link has atitle,urlanddescription. - Add a GPT step:
Answer the question using only the information below. Cite sources as
markdown links, like [[1]](URL). Don't make anything up. Answer in {{language}}.
QUESTION: {{query}}
INFORMATION:
- {{links.0.title}} {{links.0.url}}
{{page {{query}} {{links.0.url}} limit=20%}}
- {{links.1.title}} {{links.1.url}}
{{page {{query}} {{links.1.url}} limit=10%}}
- {{links.2.title}} {{links.2.url}}
{{page {{query}} {{links.2.url}} limit=10%}}
- Click Save and run it with a question.
# Good to know
- The prompt, the pages and the answer all share the model's context window. Keep the pages together under about 40% to leave room for a good answer.
- A page read by URL is kept for 5 minutes, so reading it again in that time is instant.
- A YouTube video URL gives its transcript.
- To read a long page all the way through, piece by piece, see Chunking.