File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public function __construct(
7171 $ this ->javaScriptRequired = $ javaScriptRequired ;
7272
7373 $ this ->setBrowser ($ driver );
74- $ this ->setPageHistory ();
74+ // $this->setPageHistory();
7575 }
7676
7777 /**
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ public function setNextPage($nextPageSelector = null)
109109 */
110110 public function getPageHistory ()
111111 {
112+ $ this ->setPageHistory ();
112113 return $ this ->pageHistory ;
113114 }
114115}
Original file line number Diff line number Diff line change @@ -79,6 +79,19 @@ public function testCanScrapeMultiplePage()
7979 true
8080 );
8181 $ this ->assertEquals (count ($ jsonData ), $ count );
82+ $ historyData = $ extractor ->crawler ->getPageHistory ();
83+ $ this ->assertEquals (
84+ 'http://localhost:1349/multiple-rows.php ' ,
85+ $ historyData [0 ]['url ' ]
86+ );
87+ $ this ->assertEquals (
88+ 'http://localhost:1349/multiple-rows.php?page=1 ' ,
89+ $ historyData [1 ]['url ' ]
90+ );
91+ $ this ->assertEquals (
92+ 'http://localhost:1349/multiple-rows.php?page=2 ' ,
93+ $ historyData [2 ]['url ' ]
94+ );
8295 }
8396
8497 public function testCrawlingHaltsIfHashMatches ()
You can’t perform that action at this time.
0 commit comments