Open ghost opened 6 years ago
Hello,
I think you did not call getContents. I updated the exemples and wiki now to make this more obvious.
$companyData = MFinante::cif($companyCif)->getContent();
I see but...it returns just:
array(2) {
"cif" => string(8) "30232096"
"balance_sheets" => array(4) {
0 => string(4) "2012"
1 => string(4) "2013"
2 => string(4) "2014"
3 => string(4) "2015"
}
}
for MFinante::cif($companyCif)->getContent();
and for MFinante:balanceSheet($companyCif, $year)->getContent();
returns The current node list is empty.
Hi, I installed the crawler on a xampp localhost, and it returns "The current node list is empty" error. Here is the full error message:
Fatal error: Uncaught InvalidArgumentException: The current node list is empty. in C:\xampp\htdocs\mfinante-1.0.4\vendor\symfony\dom-crawler\Crawler.php:581 Stack trace: #0 C:\xampp\htdocs\mfinante-1.0.4\src\Parsers\CompanyPage.php(41): Symfony\Component\DomCrawler\Crawler->html() #1 C:\xampp\htdocs\mfinante-1.0.4\src\Parsers\CompanyPage.php(21): ByTIC\MFinante\Parsers\CompanyPage->parseCif() #2 C:\xampp\htdocs\mfinante-1.0.4\src\Parsers\AbstractParser.php(43): ByTIC\MFinante\Parsers\CompanyPage->generateContent() #3 C:\xampp\htdocs\mfinante-1.0.4\proba.php(9): ByTIC\MFinante\Parsers\AbstractParser->getContent() #4 {main} thrown in C:\xampp\htdocs\mfinante-1.0.4\vendor\symfony\dom-crawler\Crawler.php on line 581
I've set up the project and run it as normal and nothing happened so I've made a dump on the crawler request in CompanyPage.php and this is what I get, no matter what CIF I enter. Also, in AbstractParser.php on getModel() method, $model->setParameters() was receiving the $model object not $parameters object. Anyways, the issue is with the crawler I guess...