wordpress开发手册
2.3 PHP
3.2 WordPress 插件结构和⽣命周期

2. 分页方式分析


插件支持三种分页方式:

2.1 Source 方式(从源代码选择)

- 通过 XPath 选择器定位下一页按钮/链接
- 需要设置:
- scrapenextpage: 下一页链接的 XPath 选择器
- scrape
nextpageinnerhtml: 下一页按钮的文本内容
- scrape
nextpage_type: 设置为 "source"


2.2 Parameter 方式(URL 参数)

- 通过修改 URL 参数获取下一页
- 需要设置:
- scrapenextpagetype: 设置为 "parameter"
- scrapenextpageurlparametersnames[]: URL 参数名称数组
- scrape
nextpageurlparametersvalues[]: 参数初始值数组
- scrapenextpageurlparameters_increments[]: 参数增量数组


2.3 Path 方式(路径参数)

- 通过修改 URL 路径获取下一页
- 需要设置:
- scrapenextpagetype: 设置为 "path"
- scrapepathpattern: 路径模式,使用 {page} 作为页码占位符
- scrapepathstart: 起始页码


10 Screens$8,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery 1 Revision
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages

20 Screens$16,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages

30 Screens$24,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages
0.733866s