Files
web2mcp/wechat_dev_seo_structured.json
empty b1d9f2c518 feat: 添加 LLM Content Extractor 浏览器扩展
- 支持框选区域提取网页内容
- 支持整页内容提取
- 输出格式:Markdown/JSON/XML
- 自动复制到剪贴板
2025-12-03 16:44:03 +08:00

81 lines
3.1 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[
{
"type": "heading",
"level": 1,
"content": "#小程序搜索优化指南"
},
{
"type": "paragraph",
"content": "爬虫访问小程序内页面时,会携带特定的 user-agent \"mpcrawler\" 及场景值1129"
},
{
"type": "paragraph",
"content": "判断请求是否来源于官方搜索爬虫的方法:"
},
{
"type": "paragraph",
"content": "签名算法与小程序消息推送接口的签名算法一致。 详情"
},
{
"type": "paragraph",
"content": "参数在请求的header里设置分别是\nX-WXApp-Crawler-Timestamp\nX-WXApp-Crawler-Nonce\nX-WXApp-Crawler-Signature"
},
{
"type": "paragraph",
"content": "签名流程如下:\n1.将token、X-WXApp-Crawler-Timestamp、X-WXApp-Crawler-Nonce三个参数进行字典序排序\n2.将三个参数字符串拼接成一个字符串进行sha1加密\n3.开发者获得加密后的字符串可与X-WXApp-Crawler-Signature对比标识该请求来源于微信"
},
{
"type": "heading",
"level": 2,
"content": "#1. 小程序里跳转的页面 (url) 可被直接打开。"
},
{
"type": "paragraph",
"content": "小程序页面内的跳转url是我们爬虫发现页面的重要来源且搜索引擎召回的结果页面 (url) 是必须能直接打开,不依赖上下文状态的。\n特别的建议页面所需的参数都包含在url"
},
{
"type": "heading",
"level": 2,
"content": "#2. 页面跳转优先采用navigator组件。"
},
{
"type": "paragraph",
"content": "小程序提供了两种页面路由方式: a. navigator 组件 b. 路由 API包括 navigateTo / redirectTo / switchTab / navigateBack / reLaunch\n建议使用 navigator 组件若不得不使用API可在爬虫访问时屏蔽针对点击设置的时间锁或变量锁。"
},
{
"type": "heading",
"level": 2,
"content": "#3. 清晰简洁的页面参数。"
},
{
"type": "paragraph",
"content": "结构清晰、简洁、参数有含义的 querystring 对抓取以及后续的分析都有很大帮助,但是将 JSON 数据作为参数的方式是比较糟糕的实现。"
},
{
"type": "heading",
"level": 2,
"content": "#4. 必要的时候才请求用户进行授权、登录、绑定手机号等。"
},
{
"type": "paragraph",
"content": "建议在必须的时候才要求用户授权(比如阅读文章可以匿名,而发表评论需要留名)。"
},
{
"type": "heading",
"level": 2,
"content": "#5. 我们不收录 web-view 中的任何内容。"
},
{
"type": "paragraph",
"content": "我们暂时做不到这一点,长期来看,我们可能也做不到。"
},
{
"type": "heading",
"level": 2,
"content": "#6. 设置一个清晰的标题和页面缩略图。"
},
{
"type": "paragraph",
"content": "页面标题和缩略图对于我们理解页面和提高曝光转化有重要的作用。\n通过 wx.setNavigationBarTitle 或 自定义转发内容 onShareAppMessage 对页面的标题和缩略图设置,另外也为 video、audio 组件补齐 poster / poster-for-crawler 属性。"
}
]