Prompt Coding Limited info

ScrapeGraphAI: Analyse HTML Structure Before Writing an Extractor

A prompt from ScrapeGraphAI's code-generation pipeline: given an earlier analysis of the scraping task and the HTML code, name the elements, classes or IDs for each required field, the repeated structures and nested relationships, and recommend a scraping strategy, as a concise step-by-step analysis with no code.

  • 🤖 Any chat LLM
  • 🗂️ Coding

Prompt by Scrapgraph-ai team (ScrapeGraphAI/Scrapegraph-ai) · Original source (opens in a new tab)

ScrapeGraphAI: Analyse HTML Structure Before Writing an Extractor — prompt preview

The prompt

prompt
Task: Your job is to analyze the provided HTML code in relation to the initial scraping task analysis and provide all the necessary HTML information useful for implementing a function that extracts data from the given HTML string.

**Initial Analysis**:
{initial_analysis}

**HTML Code**:
```html
{html_code}
```

**HTML Analysis Instructions**:
1. Examine the HTML code and identify elements, classes, or IDs that correspond to each required data field mentioned in the Initial Analysis.
2. Look for patterns or repeated structures that could indicate multiple items (e.g., product listings).
3. Note any nested structures or relationships between elements that are relevant to the data extraction task.
4. Discuss any additional considerations based on the specific HTML layout that are crucial for accurate data extraction.
5. Recommend the specific strategy to use for scraping the content, remeber.

**Important Notes**:
- The function that the code generator is gonig to implement will receive the HTML as a string parameter, not as a live webpage.
- No web scraping, automation, or handling of dynamic content is required.
- The analysis should focus solely on extracting data from the static HTML provided.
- Be precise and specific in your analysis, as the code generator will, possibly, not have access to the full HTML context.

This HTML analysis will be used to guide the final code generation process for a function that extracts data from the given HTML string.
Please provide only the analysis with relevant, specific information based on this HTML code. Avoid vague statements and focus on exact details needed for accurate data extraction.

Focus on providing a concise, step-by-step analysis of the HTML structure and the key elements needed for data extraction. Do not include any code examples or implementation logic. Keep the response focused and avoid general statements.**

**HTML Analysis for Data Extraction**:

What it is

A prompt from ScrapeGraphAI's code-generation pipeline: given an earlier analysis of the scraping task and the HTML code, name the elements, classes or IDs for each required field, the repeated structures and nested relationships, and recommend a scraping strategy, as a concise step-by-step analysis with no code. The repository publishes this prompt without a printed sample of its output. The prompt text comes from the Scrapegraph-ai repository (MIT License, Copyright 2024 Scrapgraph-ai team). Licence: https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/main/LICENSE. Original author: Scrapgraph-ai team (ScrapeGraphAI/Scrapegraph-ai). Changes by FoxaMind: Python string quotes removed; {...} placeholders keep the source syntax. Typos are as in the source.

Who it's for

  • Developers generating scrapers with an LLM
  • Anyone who wants selectors identified before code is written

برومبت من مسار توليد الكود في ScrapeGraphAI: انطلاقاً من تحليل سابق لمهمة الاستخراج ومن كود HTML، يحدد العناصر أو الأصناف أو المعرّفات لكل حقل مطلوب، والبنى المتكررة والعلاقات المتداخلة، ويوصي باستراتيجية الاستخراج، في تحليل موجز خطوة بخطوة دون أي كود.

Tips

  • {initial_analysis} is the output of an earlier step that maps the user's request to the wanted fields; {html_code} is the page HTML.
  • The prompt states that the extraction function will receive the HTML as a string, not a live page, so no automation or dynamic content handling is needed.
  • The same file has a version with an extra {additional_context} block.