forked from keygle/html-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParserInterface.php
More file actions
46 lines (38 loc) · 992 Bytes
/
ParserInterface.php
File metadata and controls
46 lines (38 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace HtmlParser;
/**
* Copyright (c) 2013, 俊杰Jerry
* All rights reserved.
* @description: html解析器
* @author: 俊杰Jerry<bupt1987@gmail.com>
* @date: 2013-6-10
* @version: 1.0
*/
interface ParserInterface {
/**
* 广度优先查询
* @param string $selector
* @param number $idx 找第几个,从0开始计算,null 表示都返回, 负数表示倒数第几个
* @return ParserInterface|ParserInterface[]
*/
public function findBreadthFirst($selector, $idx = null);
/**
* 深度优先查询
* @param string $selector
* @param number $idx 找第几个,从0开始计算,null 表示都返回, 负数表示倒数第几个
* @return ParserInterface|ParserInterface[]
*/
public function findDepthFirst($selector, $idx = null);
/**
* 返回文本信息
* @return string
*/
public function getPlainText();
/**
* 获取html的元属值
* @param string $name
* @return string|null
*/
public function getAttr($name);
}
?>