Web Information Extraction Flow
When the user provides a URL and the type of information they want, follow these steps.
Step 1: Confirm Fetching Capability
First, check if the current session has a web fetching tool available (e.g., web_fetch). If not, directly tell the user "The current environment does not have web fetching capabilities enabled" and stop the flow. Do not pretend to have fetched content.
Step 2: Fetch the Page
Call the available fetching tool to obtain the body content of the URL. If fetching fails (timeout, 403, empty content), report the failure reason truthfully and do not fabricate content.
Step 3: Extract Information
Based on the type of information specified by the user, extract the relevant content from the body.
- If the user wants "a specific paragraph", directly quote the original text without rewriting.
- If the user wants a "list/items", list them one by one, preserving the original order.
- If the user wants "numbers/dates/names", output only the found values, and annotate each with its context in the original text (one sentence before and after).
- "Dates" refer to visible date text on the page, including format such as YYYY-MM-DD, YYYY/MM/DD, Chinese year-month-day, English month names, etc. Do not extract copyright years in footers or dates from HTML metadata.
Step 4: Output Format
Output in the following format:
Fetch Status: Success / Failure (with reason) Page Title: [Fill in if fetched, write "Unknown" if not] Extraction Results:
- [Organized according to the information type requested by the user]
Boundaries
- Do not summarize the full page; only extract the information the user wants.
- If the page content is clearly a login page or an error page, include an explanatory note in "Extraction Results" and do not fabricate content.