f
This commit is contained in:
@@ -59,7 +59,27 @@ $env:SEO_TEST_URL="https://www.xingfucha.cn"; node test-seo.js
|
||||
curl -s -A "Baiduspider/2.0" http://localhost:3000/ | findstr /i "title description keywords canonical"
|
||||
```
|
||||
|
||||
应能看到包含「幸福查」的 title,以及 description、keywords、canonical 等标签。
|
||||
应能看到包含「天远数据」的 title,以及 description、keywords、canonical 等标签。
|
||||
|
||||
**Windows 下中文乱码说明**:服务器返回的是 UTF-8,CMD 默认是 GBK,直接 `curl … | findstr` 会看到乱码(如 `澶╄繙鏁版嵁`)或出现 “FINDSTR: 写入错误”。可任选一种方式解决:
|
||||
|
||||
```cmd
|
||||
:: 方式 1:先切到 UTF-8 再执行(CMD)
|
||||
chcp 65001
|
||||
curl -s -A "Baiduspider/2.0" https://www.tianyuandb.com/ | findstr /i "title description"
|
||||
```
|
||||
|
||||
```powershell
|
||||
# 方式 2:PowerShell 下指定输出编码
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
curl -s -A "Baiduspider/2.0" https://www.tianyuandb.com/ | Select-String -Pattern "title|description"
|
||||
```
|
||||
|
||||
```cmd
|
||||
:: 方式 3:保存到文件后用编辑器打开(任意编码都行)
|
||||
curl -s -A "Baiduspider/2.0" https://www.tianyuandb.com/ -o seo-test.html
|
||||
:: 用记事本/VSCode 打开 seo-test.html,选 UTF-8 即可看到正确中文
|
||||
```
|
||||
|
||||
```bash
|
||||
# 看完整 HTML 前几行(含 <head>)
|
||||
|
||||
Reference in New Issue
Block a user