simoncck commited on
Commit
6aa22c8
·
verified ·
1 Parent(s): 6681e06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -281,14 +281,14 @@ async def inspect(session_id: str):
281
 
282
  try:
283
  for sel in selectors:
284
- for idx, elem in enumerate(soup.select(sel)):
285
- out.append({
286
- "tag": elem.name,
287
- "selector": f"{sel}:nth-of-type({idx+1})",
288
- "text": elem.get_text(strip=True)[:100],
289
- "attributes": dict(elem.attrs),
290
- "type": elem.get("type", "N/A")
291
- })
292
  return {"elements": out, "total_count": len(out)}
293
  except Exception as e:
294
  logger.error(f"Error inspecting elements: {e}")
 
281
 
282
  try:
283
  for sel in selectors:
284
+ for idx, elem in enumerate(soup.select(sel)):
285
+ out.append({
286
+ "tag": elem.name,
287
+ "selector": f"{sel}:nth-of-type({idx+1})",
288
+ "text": elem.get_text(strip=True)[:100],
289
+ "attributes": dict(elem.attrs),
290
+ "type": elem.get("type", "N/A")
291
+ })
292
  return {"elements": out, "total_count": len(out)}
293
  except Exception as e:
294
  logger.error(f"Error inspecting elements: {e}")