SuperAPI AI Directory

dianping-info-query

Office & productivity

View repository

Updated 10-15 23:41

About this skill

Dianping Information Query Skill

Overview

This skill provides professional information query capabilities for the Dianping website (dianping.com), enabling safe and efficient retrieval of merchant information, rating data, and related details. The skill has a built-in completedual-state login detection mechanism, which can accurately identify both logged-in and not-logged-in states and provide corresponding processing procedures.

Core Function Scope

Supported Query Types

  • Merchant Search: Search merchants by keyword, location, and category
  • Business District Query: Supports overall information queries for popular business districts (such as Huimin Street, Nanjing Road, etc.)
  • Merchant Details: Obtain basic merchant information (name, address, phone, business hours)
  • Rating Information: Obtain overall rating, taste/environment/service/ingredientsub-ratings (newly added ingredient rating support)
  • Extended Information: Number of reviews, per capita spending, cuisine category, business district location, group-buy/reservation indicators
  • City Switching: Supports flexible switching among all cities covered by Dianping nationwide
  • In-Depth Information Query: Obtain recommended dish lists, user review content,review tags and high-frequency mention counts, business hours, and other in-depth information
  • Multi-Tab Management: Automatically handles new tabs generated during the search process to ensure operational continuity

Unsupported Functions

  • Personalized content requiring in-depth login verification (such as personal favorites and history)
  • Batch automated queries (single queries are the main focus)

Login Status Detection and Handling

Dual-State Detection Mechanism

  1. Not-Logged-In Status Detection:

    • Check whether the text "Please log in/register" exists in the upper right corner of the page
    • Check whether the URL containsaccount.dianping.com/pclogin
    • Find login-related QR code images or form elements
  2. Logged-In Status Detection:

    • Check whether a username element exists (.nick-name or .username)
    • Verify whether the user avatar element (.user-face) exists
    • Confirm whether the personal center link is accessible

User Guidance Process

Not-Logged-In Status:

  1. Immediately pause automated operations
  2. Explain to the user that manual login is currently required
  3. Provide specific login guidance (mainly QR code scan login)
  4. Wait for the user to confirm login completion before continuing the query

Logged-In Status:

  1. Directly execute the query operation
  2. Use the logged-in status to obtain more complete merchant information
  3. If an exception occurs, re-detect the login status

Standardized Operation SOP Process

Basic Query Process

Step 1: 导航到大众点评首页 (https://www.dianping.com)
Step 2: 使用backbone分析页面结构,检测登录状态(双状态检测)
Step 3: 
   - 未登录:暂停并引导用户手动完成登录
   - 已登录:继续执行查询
Step 4: 动态定位搜索框并输入查询关键词
   - 使用search工具动态查找多种选择器:#myInput, #J-search-input, input.j-search-input
   - 优先使用placeholder属性进行模糊匹配:input[placeholder*='搜索']
   - 避免硬编码ref引用,提高跨页面稳定性
Step 5: 提交搜索并等待结果页面加载
Step 6: 自动处理标签页切换(如产生新标签页)
Step 7: 使用readability提取结构化信息(包含完整分项评分和用户标签)
Step 8: 返回整理后的商户信息

City Switching Process

Step 1: 导航到当前城市页面
Step 2: 点击城市选择图标(img.city-select-icon)
Step 3: 在城市列表页面搜索目标城市
Step 4: 点击目标城市链接完成切换
Step 5: 验证城市切换成功(检查URL和当前城市显示)
Step 6: 执行目标城市的查询操作

Deep Information Query Process

Step 1: 完成基础查询,进入商户详情页面
Step 2: 使用readability提取完整页面内容(自动包含食材评分和用户标签次数)
Step 3: 定位推荐菜区域(#shop-dish)获取菜品列表
Step 4: 提取用户评论信息(评分、评论数量、评论标签及提及次数、详细评论内容)
Step 5: 整理并返回完整的深度信息

Multi-Tab Management Process

Step 1: 执行可能产生新标签页的操作(如搜索提交)
Step 2: 使用list_tabs获取所有打开的标签页
Step 3: 识别最新打开的标签页(通常为搜索结果页)
Step 4: 自动focus到最新标签页
Step 5: 验证标签页URL和标题确保正确性
Step 6: 继续后续操作

Browser Tool Action Support List

Navigation and Page Analysis

  • navigate: Access a specified URL (homepage or specific merchant page)
  • backbone: Analyze the overall page structure and identify key interactive elements
  • search: Prioritize usingDynamically locate specific elements (search box, merchant cards, rating elements, etc.)
  • readability: Extract structured text content from the merchant detail page (Recommended first choice)
  • list_tabs: Get information on all open tabs (for multi-tab management)

User Interaction

  • type: Enter query keywords in the search box
  • click: Click the search button, merchant link, or city selection icon
  • press: Simulate keyboard operations (such as pressing Enter to submit)
  • focus_tab: Switch to a specified tab (for multi-tab scenarios)

Content Extraction

  • readability: Preferred solutionExtract the complete structured content of the merchant detail page (including ingredient ratings, user tag counts, etc.)
  • snapshot: Get the complete DOM for complex content analysis (Fallback solution)

Specific Operation Examples

Example 1: Query Chengdu Xiaolongkan Hot Pot (logged-in state)

// Step 1: 导航到首页
use_browser(action="navigate", url="https://www.dianping.com")

// Step 2: 检测登录状态
use_browser(action="backbone")
// 检查是否存在用户名元素(已登录状态)

// Step 3: 动态定位搜索框
use_browser(action="search", query="#myInput")

// Step 4: 执行搜索(已登录,直接执行)
use_browser(action="type", ref="found-ref", text="成都小龙坎老火锅", submit=true)

// Step 5: 提取完整结果(包含食材评分4.7、用户标签次数等)
use_browser(action="readability")

Example 2: Handle the not-logged-in state

// Step 1: 导航到首页
use_browser(action="navigate", url="https://www.dianping.com")

// Step 2: 检测到未登录状态
use_browser(action="backbone")
// 发现"请登录/注册"文本

// Step 3: 引导用户手动登录
// [暂停操作,提示用户扫码登录]

// Step 4: 用户确认登录后继续
use_browser(action="search", query="#myInput")
use_browser(action="type", ref="found-ref", text="北京中关村 咖啡店", submit=true)

Example 3: City switching operation

// Step 1: 导航到当前城市
use_browser(action="navigate", url="https://www.dianping.com")

// Step 2: 点击城市选择图标
use_browser(action="search", query=".city-select-icon")
use_browser(action="click", ref="found-ref")

// Step 3: 搜索目标城市
use_browser(action="search", query="成都")

// Step 4: 点击成都城市链接
use_browser(action="click", ref="found-beijing-ref")

// Step 5: 验证切换成功后执行查询
use_browser(action="search", query="#myInput")
use_browser(action="type", ref="found-ref", text="小龙坎火锅", submit=true)

Example 4: Deep information query (including ingredient ratings and user tags)

// Step 1: 进入商户详情页面后
use_browser(action="readability") // 提取完整页面内容

// 结果将包含:
// - 综合评分: 4.4分
// - 分项评分: 口味4.4, 环境4.4, 服务4.4, 食材4.7
// - 用户标签: ["排队情况(2269次)", "收银员态度好(647次)", "环境干净整洁(646次)", ...]
// - 推荐菜: ["鸳鸯锅", "玫瑰圆子", "牛奶鸭血", ...]
// - 营业时间: 11:00-次日02:00

Example 5: Dynamic search box positioning (enhanced stability)

// 使用search工具动态定位搜索框,避免硬编码
use_browser(action="search", query="#myInput")
// 或在搜索结果页
use_browser(action="search", query="#J-search-input")

// 根据返回的ref进行操作
use_browser(action="type", ref="found-ref", text="查询关键词", submit=true)

Example 6: Cross-page dynamic search box positioning (latest optimization)

// 统一的搜索框定位策略,兼容不同页面
use_browser(action="search", query="input[placeholder*='搜索'],#myInput,#J-search-input,input.j-search-input")
// 选择第一个找到的搜索框
use_browser(action="type", ref="first-found-ref", text="西安回民街", submit=true)

Example 7: Automatic tab management (latest optimization)

// 执行搜索后自动处理标签页
use_browser(action="type", ref="search-input-ref", text="回民街", submit=true)

// 获取所有标签页
use_browser(action="list_tabs")

// 自动切换到最新标签页(搜索结果页)
use_browser(action="focus_tab", targetId="latest-search-tab-id")

// 继续后续操作
use_browser(action="readability")

Example 8: Business district query support (latest optimization)

// 查询热门商圈(如回民街、南京路等)
use_browser(action="search", query="input[placeholder*='搜索']")
use_browser(action="type", ref="found-ref", text="西安回民街", submit=true)

// 提取商圈整体信息
use_browser(action="readability")
// 结果包含商圈评分、总评价数、热门标签、地理位置等信息

Error Handling and Best Practices

Common Issue Handling

  • Abnormal login state: Recheck the login state and re-guide if necessary
  • Network timeout: Retry 1-2 times; if it still fails, report the error
  • Element not found:Use search for dynamic positioning, avoid hardcoding ref (important optimization)
  • Incomplete content loading: Add an appropriate waiting time or use wait_for
  • Search results are empty: Provide a friendly empty-result prompt
  • City switching failed: Verify the city list page structure and relocate the city link
  • CAPTCHA/slider verification: Identify the security mechanism and guide the user to handle it manually
  • Abnormal tab management: Use list_tabs to retrieve the tab list again to ensure correct operations

Performance Optimization Suggestions

  • **Prioritize usingreadabilityrather thansnapshot** to improve efficiency and information completeness
  • Usesearchtool for dynamic element positioning(core optimization point)
  • Implement automatic multi-tab management, avoid manual switching errors
  • Avoid unnecessary page refreshes and repeated navigation
  • Set timeout periods reasonably (30-60 seconds recommended)
  • Use login state persistence to reduce repeated logins
  • Verify URL changes after city switching to ensure the switch is successful
  • Fully extract sub-item ratings, including the newly added ingredient rating dimension
  • Extract user tags and mention counts, providing richer user feedback analysis
  • Support business district queries, expanding the coverage of application scenarios

Reference Resources

Browser tool documentation

  • references/browser-actions.md: Detailed guide for using browser tool Actions (dynamic positioning strategy updated)
  • references/dianping-selectors.md: Reference for commonly used Dianping CSS selectors (ingredient ratings and user tags updated)
  • references/tab-management.md: Best practices guide for handling multiple tabs (newly added)
  • references/city-switching.md: City switching operation guide
  • references/deep-info-extraction.md: In-depth information extraction methods (business district query support updated)

Operation workflow templates

  • references/query-workflow.md: Standard query workflow template
  • references/login-handling.md: Best practices for dual-state login handling

Usage scenario trigger conditions

This skill should be triggered when users make the following types of requests:

  • "Help me look up [location][type] stores on Dianping"
  • "Search [keyword] on Dianping"
  • "Get detailed information about a certain store on Dianping"
  • "Query a Dianping merchant's rating and address"
  • "Check the number of reviews and per capita price of a certain store on Dianping"
  • "Switch to [city] to query [keyword]"
  • "Get a certain store's recommended dishes and user reviews"
  • "Query a merchant's ingredient ratings and user tags"
  • "Query overall information for popular business districts (such as Huimin Street, Nanjing Road)"
  • Any request involving extracting structured merchant information from the Dianping website

Verification Status

This skill has been verified across multiple scenarios, including:

  • ✅ Beijing Zhongguancun coffee shop query
  • ✅ Shanghai Bund restaurant query
  • ✅ Guangzhou Tianhe Cantonese cuisine query
  • ✅ Chengdu Xiaolongkan hot pot query (latest verification, confirming extraction of ingredient rating 4.7 and user tag counts)
  • ✅ Hangzhou Laoshan noodle shop query
  • ✅ Xi'an Huimin Street business district query (latest verification, confirming cross-region city switching, business district information extraction, and multi-tab management functions)

The skill now fully complies with Anthropic standard skill specifications and can run stably in production environments.