| 1 | <?php |
||
| 13 | class CrawlerSession |
||
| 14 | { |
||
| 15 | use TraverseTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * CrawlerInterface |
||
| 19 | */ |
||
| 20 | private $crawler; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param CrawlerInterface $crawler |
||
| 24 | */ |
||
| 25 | 1 | public function __construct(CrawlerInterface $crawler) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param Query\AbstractQuery $query |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | 1 | public function queryIds(Query\AbstractQuery $query) |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @return CrawlerInterface |
||
| 41 | */ |
||
| 42 | 1 | public function getCrawler() |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $uri |
||
| 49 | * @return self |
||
| 50 | */ |
||
| 51 | 1 | public function open($uri) |
|
| 59 | |||
| 60 | /** |
||
| 61 | * @return UriInterface |
||
| 62 | */ |
||
| 63 | 1 | public function getUri() |
|
| 67 | |||
| 68 | /** |
||
| 69 | * @return string |
||
| 70 | */ |
||
| 71 | 1 | public function getHtml() |
|
| 75 | |||
| 76 | /** |
||
| 77 | * Save the HTML of the session into a file |
||
| 78 | * Optionally resolve all the links with a base uri |
||
| 79 | * |
||
| 80 | * @param string $filename |
||
| 81 | * @param UriInterface|string $base |
||
| 82 | */ |
||
| 83 | 1 | public function saveHtml($filename, $base = null) |
|
| 93 | } |
||
| 94 |