dianping-info-query
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese大众点评信息查询技能
Dianping Information Query Skill
概述
Overview
本技能提供对大众点评网站(dianping.com)的专业信息查询能力,能够安全、高效地获取商户信息、评分数据和相关详情。技能内置完整的双状态登录检测机制,能够准确识别已登录和未登录两种状态,并提供相应的处理流程。
This skill provides professional information query capabilities for the Dianping website (dianping.com), enabling safe and efficient acquisition of merchant information, rating data and related details. The skill has a built-in complete Dual-State Login Detection Mechanism, which can accurately identify two states: logged in and not logged in, and provide corresponding processing procedures.
核心功能范围
Core Function Scope
支持的查询类型
Supported Query Types
- 商户搜索:按关键词、地点、分类搜索商户
- 商圈查询:支持热门商圈(如回民街、南京路等)的整体信息查询
- 商户详情:获取商户基本信息(名称、地址、电话、营业时间)
- 评分信息:获取综合评分、口味/环境/服务/食材分项评分(新增食材评分支持)
- 扩展信息:评价数量、人均消费、菜系分类、商圈位置、团购/订座标识
- 城市切换:支持在全国所有大众点评覆盖城市间灵活切换
- 深度信息查询:获取推荐菜列表、用户评论内容、评论标签及高频提及次数、营业时间等深度信息
- 多标签页管理:自动处理搜索过程中产生的新标签页,确保操作连续性
- Merchant Search: Search merchants by keyword, location, category
- Business District Query: Support overall information query of popular business districts (such as Muslim Quarter, Nanjing Road, etc.)
- Merchant Details: Obtain basic merchant information (name, address, phone number, business hours)
- Rating Information: Obtain overall rating, sub-item ratings for taste/environment/service/ingredients (newly added ingredient rating support)
- Extended Information: Number of reviews, average consumption, cuisine category, business district location, group booking/reservation mark
- City Switching: Support flexible switching between all Dianping-covered cities across the country
- Deep Information Query: Obtain recommended dish lists, user review content, review tags and high-frequency mention counts, business hours and other deep information
- Multi-Tab Management: Automatically handle new tabs generated during the search process to ensure operational continuity
不支持的功能
Unsupported Functions
- 需要深度登录验证的个人化内容(如个人收藏、历史记录)
- 批量自动化查询(单次查询为主)
- Personalized content requiring in-depth login verification (such as personal favorites, history records)
- Batch automated queries (mainly single queries)
登录状态检测与处理
Login State Detection and Processing
双状态检测机制
Dual-State Detection Mechanism
-
未登录状态检测:
- 检查页面右上角是否存在"请登录/注册"文本
- 检查URL是否包含
account.dianping.com/pclogin - 查找登录相关的二维码图片或表单元素
-
已登录状态检测:
- 检查是否存在用户名元素(或
.nick-name).username - 验证用户头像元素()是否存在
.user-face - 确认个人中心链接是否可访问
- 检查是否存在用户名元素(
-
Not Logged-in State Detection:
- Check if the text "Please Login/Register" exists in the upper right corner of the page
- Check if the URL contains
account.dianping.com/pclogin - Find login-related QR code images or form elements
-
Logged-in State Detection:
- Check if the username element (or
.nick-name) exists.username - Verify if the user avatar element () exists
.user-face - Confirm if the personal center link is accessible
- Check if the username element (
用户引导流程
User Guidance Process
未登录状态:
- 立即暂停自动化操作
- 向用户说明当前需要手动登录
- 提供具体的登录指导(主要为二维码扫码登录)
- 等待用户确认登录完成后再继续执行查询
已登录状态:
- 直接执行查询操作
- 利用登录状态获取更完整的商户信息
- 如遇异常,重新检测登录状态
Not Logged-in State:
- Immediately pause automated operations
- Inform the user that manual login is required
- Provide specific login guidance (mainly QR code scan login)
- Wait for the user to confirm login completion before continuing the query
Logged-in State:
- Directly execute query operations
- Use the logged-in state to obtain more complete merchant information
- Re-detect the login state if an exception occurs
标准化操作SOP流程
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: 返回整理后的商户信息Step 1: Navigate to Dianping homepage (https://www.dianping.com)
Step 2: Use backbone to analyze page structure and detect login state (dual-state detection)
Step 3:
- Not logged in: Pause and guide the user to complete login manually
- Logged in: Continue to execute the query
Step 4: Dynamically locate the search box and enter query keywords
- Use the search tool to dynamically find multiple selectors: #myInput, #J-search-input, input.j-search-input
- Prioritize using the placeholder attribute for fuzzy matching: input[placeholder*='搜索']
- Avoid hard-coded ref references to improve cross-page stability
Step 5: Submit the search and wait for the result page to load
Step 6: Automatically handle tab switching (if new tabs are generated)
Step 7: Use readability to extract structured information (including complete sub-item ratings and user tags)
Step 8: Return the organized merchant information城市切换流程
City Switching Process
Step 1: 导航到当前城市页面
Step 2: 点击城市选择图标(img.city-select-icon)
Step 3: 在城市列表页面搜索目标城市
Step 4: 点击目标城市链接完成切换
Step 5: 验证城市切换成功(检查URL和当前城市显示)
Step 6: 执行目标城市的查询操作Step 1: Navigate to the current city page
Step 2: Click the city selection icon (img.city-select-icon)
Step 3: Search for the target city on the city list page
Step 4: Click the target city link to complete the switch
Step 5: Verify successful city switching (check URL and current city display)
Step 6: Execute the query operation for the target city深度信息查询流程
Deep Information Query Process
Step 1: 完成基础查询,进入商户详情页面
Step 2: 使用readability提取完整页面内容(自动包含食材评分和用户标签次数)
Step 3: 定位推荐菜区域(#shop-dish)获取菜品列表
Step 4: 提取用户评论信息(评分、评论数量、评论标签及提及次数、详细评论内容)
Step 5: 整理并返回完整的深度信息Step 1: Complete the basic query and enter the merchant details page
Step 2: Use readability to extract complete page content (automatically includes ingredient ratings and user tag counts)
Step 3: Locate the recommended dish area (#shop-dish) to obtain the dish list
Step 4: Extract user review information (ratings, number of reviews, review tags and mention counts, detailed review content)
Step 5: Organize and return complete deep information多标签页管理流程
Multi-Tab Management Process
Step 1: 执行可能产生新标签页的操作(如搜索提交)
Step 2: 使用list_tabs获取所有打开的标签页
Step 3: 识别最新打开的标签页(通常为搜索结果页)
Step 4: 自动focus到最新标签页
Step 5: 验证标签页URL和标题确保正确性
Step 6: 继续后续操作Step 1: Perform operations that may generate new tabs (such as search submission)
Step 2: Use list_tabs to get all open tabs
Step 3: Identify the newly opened tab (usually the search result page)
Step 4: Automatically focus on the latest tab
Step 5: Verify the tab URL and title to ensure correctness
Step 6: Continue subsequent operations浏览器工具Action支持清单
Browser Tool Action Support List
导航与页面分析
Navigation and Page Analysis
- : 访问指定URL(首页或具体商户页面)
navigate - : 分析页面整体结构,识别关键交互元素
backbone - : 优先使用动态定位特定元素(搜索框、商户卡片、评分元素等)
search - : 提取商户详情页面的结构化文本内容(推荐首选)
readability - : 获取所有打开的标签页信息(用于多标签页管理)
list_tabs
- : Access the specified URL (homepage or specific merchant page)
navigate - : Analyze the overall page structure and identify key interactive elements
backbone - : Prioritized for dynamically locating specific elements (search boxes, merchant cards, rating elements, etc.)
search - : Extract structured text content from merchant details pages (Recommended first choice)
readability - : Get information of all open tabs (used for multi-tab management)
list_tabs
用户交互
User Interaction
- : 在搜索框中输入查询关键词
type - : 点击搜索按钮、商户链接或城市选择图标
click - : 模拟键盘操作(如Enter提交)
press - : 切换到指定标签页(用于多标签页场景)
focus_tab
- : Enter query keywords in the search box
type - : Click the search button, merchant link or city selection icon
click - : Simulate keyboard operations (such as Enter to submit)
press - : Switch to the specified tab (used for multi-tab scenarios)
focus_tab
内容提取
Content Extraction
- : 首选方案提取商户详情页面的完整结构化内容(包含食材评分、用户标签次数等)
readability - : 获取完整DOM用于复杂内容分析(备用方案)
snapshot
- : Preferred solution to extract complete structured content from merchant details pages (including ingredient ratings, user tag counts, etc.)
readability - : Obtain the complete DOM for complex content analysis (Alternative solution)
snapshot
具体操作示例
Specific Operation Examples
示例1:查询成都小龙坎火锅(已登录状态)
Example 1: Query Chengdu Xiaolongkan Hot Pot (Logged-in State)
javascript
// 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")javascript
// Step 1: Navigate to homepage
use_browser(action="navigate", url="https://www.dianping.com")
// Step 2: Detect login state
use_browser(action="backbone")
// Check if the username element exists (logged-in state)
// Step 3: Dynamically locate the search box
use_browser(action="search", query="#myInput")
// Step 4: Execute search (logged in, execute directly)
use_browser(action="type", ref="found-ref", text="成都小龙坎老火锅", submit=true)
// Step 5: Extract complete results (including ingredient rating 4.7, user tag counts, etc.)
use_browser(action="readability")示例2:处理未登录状态
Example 2: Handle Not Logged-in State
javascript
// 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)javascript
// Step 1: Navigate to homepage
use_browser(action="navigate", url="https://www.dianping.com")
// Step 2: Detect not logged-in state
use_browser(action="backbone")
// Found the text "Please Login/Register"
// Step 3: Guide user to login manually
// [Pause operation, prompt user to scan QR code to login]
// Step 4: Continue after user confirms login
use_browser(action="search", query="#myInput")
use_browser(action="type", ref="found-ref", text="北京中关村 咖啡店", submit=true)示例3:城市切换操作
Example 3: City Switching Operation
javascript
// 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)javascript
// Step 1: Navigate to current city
use_browser(action="navigate", url="https://www.dianping.com")
// Step 2: Click city selection icon
use_browser(action="search", query=".city-select-icon")
use_browser(action="click", ref="found-ref")
// Step 3: Search for target city
use_browser(action="search", query="成都")
// Step 4: Click Chengdu city link
use_browser(action="click", ref="found-beijing-ref")
// Step 5: Execute query after verifying successful switch
use_browser(action="search", query="#myInput")
use_browser(action="type", ref="found-ref", text="小龙坎火锅", submit=true)示例4:深度信息查询(包含食材评分和用户标签)
Example 4: Deep Information Query (Including Ingredient Ratings and User Tags)
javascript
// Step 1: 进入商户详情页面后
use_browser(action="readability") // 提取完整页面内容
// 结果将包含:
// - 综合评分: 4.4分
// - 分项评分: 口味4.4, 环境4.4, 服务4.4, 食材4.7
// - 用户标签: ["排队情况(2269次)", "收银员态度好(647次)", "环境干净整洁(646次)", ...]
// - 推荐菜: ["鸳鸯锅", "玫瑰圆子", "牛奶鸭血", ...]
// - 营业时间: 11:00-次日02:00javascript
// Step 1: After entering the merchant details page
use_browser(action="readability") // Extract complete page content
// Results will include:
// - Overall Rating: 4.4 points
// - Sub-item Ratings: Taste 4.4, Environment 4.4, Service 4.4, Ingredients 4.7
// - User Tags: ["Queue situation(2269 times)", "Cashier attitude good(647 times)", "Environment clean and tidy(646 times)", ...]
// - Recommended Dishes: ["Mandarin Duck Pot", "Rose Meatball", "Milk Duck Blood", ...]
// - Business Hours: 11:00-02:00 next day示例5:动态搜索框定位(增强稳定性)
Example 5: Dynamic Search Box Positioning (Enhanced Stability)
javascript
// 使用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)javascript
// Use search tool to dynamically locate search box, avoid hard coding
use_browser(action="search", query="#myInput")
// Or on search result page
use_browser(action="search", query="#J-search-input")
// Perform operations based on returned ref
use_browser(action="type", ref="found-ref", text="Query Keyword", submit=true)示例6:跨页面搜索框动态定位(最新优化)
Example 6: Cross-Page Search Box Dynamic Positioning (Latest Optimization)
javascript
// 统一的搜索框定位策略,兼容不同页面
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)javascript
// Unified search box positioning strategy, compatible with different pages
use_browser(action="search", query="input[placeholder*='搜索'],#myInput,#J-search-input,input.j-search-input")
// Select the first found search box
use_browser(action="type", ref="first-found-ref", text="西安回民街", submit=true)示例7:自动标签页管理(最新优化)
Example 7: Automatic Tab Management (Latest Optimization)
javascript
// 执行搜索后自动处理标签页
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")javascript
// Automatically handle tabs after executing search
use_browser(action="type", ref="search-input-ref", text="回民街", submit=true)
// Get all tabs
use_browser(action="list_tabs")
// Automatically switch to the latest tab (search result page)
use_browser(action="focus_tab", targetId="latest-search-tab-id")
// Continue subsequent operations
use_browser(action="readability")示例8:商圈查询支持(最新优化)
Example 8: Business District Query Support (Latest Optimization)
javascript
// 查询热门商圈(如回民街、南京路等)
use_browser(action="search", query="input[placeholder*='搜索']")
use_browser(action="type", ref="found-ref", text="西安回民街", submit=true)
// 提取商圈整体信息
use_browser(action="readability")
// 结果包含商圈评分、总评价数、热门标签、地理位置等信息javascript
// Query popular business districts (such as Muslim Quarter, Nanjing Road, etc.)
use_browser(action="search", query="input[placeholder*='搜索']")
use_browser(action="type", ref="found-ref", text="西安回民街", submit=true)
// Extract overall business district information
use_browser(action="readability")
// Results include business district rating, total number of reviews, popular tags, geographic location, etc.错误处理与最佳实践
Error Handling and Best Practices
常见问题处理
Common Issue Handling
- 登录状态异常:重新检测登录状态,必要时重新引导
- 网络超时:重试1-2次,如仍失败则报告错误
- 元素未找到:使用search动态定位,避免硬编码ref(重要优化)
- 内容加载不全:添加适当的等待时间或使用wait_for
- 搜索结果为空:提供友好的空结果提示
- 城市切换失败:验证城市列表页面结构,重新定位城市链接
- 验证码/滑块验证:识别安全机制,引导用户手动处理
- 标签页管理异常:使用list_tabs重新获取标签页列表,确保操作正确性
- Abnormal Login State: Re-detect login state, re-guide if necessary
- Network Timeout: Retry 1-2 times, report error if still failed
- Element Not Found: Use search for dynamic positioning, avoid hard-coded refs (key optimization)
- Incomplete Content Loading: Add appropriate waiting time or use wait_for
- Empty Search Results: Provide friendly empty result prompts
- City Switching Failed: Verify city list page structure, re-locate city link
- Verification Code/Slider Verification: Identify security mechanisms, guide user to handle manually
- Abnormal Tab Management: Use list_tabs to re-obtain tab list, ensure operation correctness
性能优化建议
Performance Optimization Suggestions
- **优先使用而非
readability**以提高效率和信息完整性snapshot - 使用工具进行动态元素定位(核心优化点)
search - 实施多标签页自动管理,避免手动切换错误
- 避免不必要的页面刷新和重复导航
- 合理设置超时时间(建议30-60秒)
- 利用登录状态持久化特性减少重复登录
- 城市切换后验证URL变化确保切换成功
- 完整提取分项评分,包括新增的食材评分维度
- 提取用户标签及提及次数,提供更丰富的用户反馈分析
- 支持商圈查询,扩展应用场景覆盖范围
- Prioritize over
readabilityto improve efficiency and information completenesssnapshot - Use tool for dynamic element positioning (core optimization point)
search - Implement automatic multi-tab management to avoid manual switching errors
- Avoid unnecessary page refreshes and repeated navigation
- Set reasonable timeout (30-60 seconds recommended)
- Utilize login state persistence to reduce repeated logins
- Verify URL changes after city switching to ensure success
- Extract complete sub-item ratings, including the newly added ingredient rating dimension
- Extract user tags and mention counts to provide richer user feedback analysis
- Support business district queries to expand application scenario coverage
参考资源
Reference Resources
浏览器工具文档
Browser Tool Documentation
- :详细的浏览器工具Action使用指南(已更新动态定位策略)
references/browser-actions.md - :大众点评常用CSS选择器参考(已更新食材评分和用户标签)
references/dianping-selectors.md - :多标签页处理最佳实践指南(新增)
references/tab-management.md - :城市切换操作指南
references/city-switching.md - :深度信息提取方法(已更新商圈查询支持)
references/deep-info-extraction.md
- : Detailed browser tool Action usage guide (updated with dynamic positioning strategy)
references/browser-actions.md - : Common CSS selector reference for Dianping (updated with ingredient ratings and user tags)
references/dianping-selectors.md - : Best practice guide for multi-tab processing (newly added)
references/tab-management.md - : City switching operation guide
references/city-switching.md - : Deep information extraction methods (updated with business district query support)
references/deep-info-extraction.md
操作流程模板
Operation Process Templates
- :标准查询工作流模板
references/query-workflow.md - :双状态登录处理最佳实践
references/login-handling.md
- : Standard query workflow template
references/query-workflow.md - : Best practices for dual-state login handling
references/login-handling.md
使用场景触发条件
Usage Scenario Trigger Conditions
当用户提出以下类型的需求时,应触发本技能:
- "帮我查一下大众点评上[地点][类型]的店铺"
- "在大众点评搜索[关键词]"
- "获取大众点评上某家店的详细信息"
- "查询大众点评的商户评分和地址"
- "查看大众点评上某家店的评价数量和人均价格"
- "切换到[城市]查询[关键词]"
- "获取某家店的推荐菜和用户评论"
- "查询商户的食材评分和用户标签"
- "查询热门商圈(如回民街、南京路)的整体信息"
- 任何涉及从大众点评网站提取结构化商户信息的请求
This skill should be triggered when users put forward the following types of requests:
- "Help me check [location][type] stores on Dianping"
- "Search [keyword] on Dianping"
- "Get detailed information of a store on Dianping"
- "Query merchant ratings and addresses on Dianping"
- "Check the number of reviews and average consumption of a store on Dianping"
- "Switch to [city] to query [keyword]"
- "Get recommended dishes and user reviews of a store"
- "Query ingredient ratings and user tags of a merchant"
- "Query overall information of popular business districts (such as Muslim Quarter, Nanjing Road)"
- Any request involving extracting structured merchant information from the Dianping website
验证状态
Verification Status
本技能已通过多场景验证,包括:
- ✅ 北京中关村咖啡店查询
- ✅ 上海外滩餐厅查询
- ✅ 广州天河粤菜查询
- ✅ 成都小龙坎火锅查询(最新验证,确认食材评分4.7和用户标签次数提取)
- ✅ 杭州老陕面馆查询
- ✅ 西安回民街商圈查询(最新验证,确认跨区域城市切换、商圈信息提取、多标签页管理功能)
技能现已完全符合Anthropic标准skill规范,能够在生产环境中稳定运行。
This skill has been verified through multiple scenarios, including:
- ✅ Query of coffee shops in Zhongguancun, Beijing
- ✅ Query of restaurants in the Bund, Shanghai
- ✅ Query of Cantonese restaurants in Tianhe, Guangzhou
- ✅ Query of Xiaolongkan Hot Pot in Chengdu (latest verification, confirmed extraction of ingredient rating 4.7 and user tag counts)
- ✅ Query of Laoshan Noodle House in Hangzhou
- ✅ Query of Muslim Quarter business district in Xi'an (latest verification, confirmed cross-region city switching, business district information extraction, multi-tab management functions)
The skill now fully complies with Anthropic standard skill specifications and can run stably in production environments.