frkhan commited on
Commit
df26504
·
1 Parent(s): cd825a9

-- Added an accordion to show instruction on how to use this app

Browse files

-- Autofocus the url input textbox after page loading is completed.

Files changed (1) hide show
  1. app.py +14 -21
app.py CHANGED
@@ -156,30 +156,23 @@ with gr.Blocks() as gradio_ui:
156
  </div>
157
  """)
158
 
159
- gr.HTML("""
160
- <div style="margin-bottom: 20px; padding: 20px; border: 1px solid #ddd; border-radius: 5px;">
161
- <h2 style="margin-top: 0;">How to Use This App</h2>
162
- <p>This app combines web scraping with the power of Large Language Models (LLMs) to extract specific information from web pages. Here's how it works:</p>
163
- <ol>
164
- <li><strong>Enter a URL:</strong> Provide the URL of the web page you want to analyze.</li>
165
- <li><strong>Define Your Query:</strong> Specify the exact information you're looking for (e.g., product name, price, customer ratings).</li>
166
- <li><strong>Scrape the Web Page:</strong> Click the "Scrape with FireCrawl" button to extract the content of the page.</li>
167
- <li><strong>Select Model & Provider:</strong> Choose the LLM model you want to use for information extraction.</li>
168
- <li><strong>Extract Info by LLM:</strong> Click the "Extract Info by LLM" button to get the information based on your query.</li>
169
- </ol>
170
-
171
- <br />
172
- <br />
173
-
174
- <p><strong>What makes this different from a regular web scraper?</strong> </p>
175
-
176
- <p>Traditional web scrapers require pre-programming to extract product data for each specific website. These scrapers are brittle and can break if the website's design changes. This app uses LLMs to <em>understand</em> your query and extract only the relevant information, saving you time and effort and removing the need for constant maintenance.</p>
177
- </div>
178
- """)
179
 
180
 
181
  with gr.Column():
182
- url_input = gr.Textbox(label="Enter URL to scrape", placeholder="https://example.com/query?search=cat+food")
183
  query_input = gr.Textbox(label="What information do you want to find?", placeholder="Find product name, price, rating etc. / Summarize the content of this page")
184
 
185
  with gr.Row():
 
156
  </div>
157
  """)
158
 
159
+ with gr.Accordion("ℹ️ How to Use This App", open=False):
160
+ gr.Markdown("""
161
+ This app combines web scraping with the power of Large Language Models (LLMs) to extract specific information from web pages. Here's how it works:
162
+ 1. **Enter a URL:** Provide the URL of the web page you want to analyze.
163
+ 2. **Define Your Query:** Specify the exact information you're looking for (e.g., product name, price, customer ratings).
164
+ 3. **Scrape the Web Page:** Choose a scraper and click the "Scrape Website" button to extract the content of the page.
165
+ 4. **Select Model & Provider:** Choose the LLM model you want to use for information extraction.
166
+ 5. **Extract Info by LLM:** Click the "Extract Info by LLM" button to get the information based on your query.
167
+
168
+ ---
169
+ **What makes this different from a regular web scraper?**
170
+ Traditional web scrapers require pre-programming to extract product data for each specific website. These scrapers are brittle and can break if the website's design changes. This app uses LLMs to <em>understand</em> your query and extract only the relevant information, saving you time and effort and removing the need for constant maintenance.
171
+ """)
 
 
 
 
 
 
 
172
 
173
 
174
  with gr.Column():
175
+ url_input = gr.Textbox(label="Enter URL to scrape", placeholder="https://example.com/query?search=cat+food", autofocus=True)
176
  query_input = gr.Textbox(label="What information do you want to find?", placeholder="Find product name, price, rating etc. / Summarize the content of this page")
177
 
178
  with gr.Row():