我使用DomCrawler獲得從谷歌Play的數據頁和它的作品的情況下,99%,除了我偶然發現了一個網頁,它無法找到具體的股利。我檢查了HTML代碼,它肯定存在。我的代碼是的Symfony的DomCrawler沒有找到一個特定的標籤
$autoloader = require __DIR__.'\vendor\autoload.php';
use Symfony\Component\DomCrawler\Crawler;
$app_id = 'com.balintinfotech.sinhalesekeyboardfree';
$response = file_get_contents('https://play.google.com/store/apps/details?id='.$app_id);
$crawler = new Crawler($response);
echo $crawler->filter('div[itemprop="datePublished"]')->text();
當我運行的特定網頁,我得到
PHP Fatal error: Uncaught InvalidArgumentException: The current node list is empty.
不過,如果我使用任何其他ID,我得到了想要的結果。究竟什麼是關於頁面,打破DomCrawler
這是否只發生這一個頁面,你?我能得到它的工作:'14日馬索德2017'(通過直接複製/粘貼代碼) – ishegg
@ishegg就在這個頁面上。我看到你用西班牙文得到了你的結果,所以這隻會影響英文頁面。 –
@ishegg可以嘗試使用以下URL'的https://play.google.com/store/apps/details ID = com.balintinfotech.sinhalesekeyboardfree&HL = en' –