提问人:Nolesh 提问时间:2/9/2019 更新时间:2/9/2019 访问量:240
PHP 简单 HTML DOM 解析器返回空白图像
PHP Simple HTML DOM Parser returns blank images
问:
我正在使用库(版本 1.5 ($Rev: 196 $)) 从中解析页面以获取屏幕截图。问题是有时它会返回空白图像 () 而不是应用程序屏幕截图(例如 )。SimpleHtmlDom
Google Play
data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw
https://lh3.googleusercontent.com/SLp7-1W6c-LIl5nJkQWrYIb5i7b4XJwdjIox9CtnmRZF_tlWixLSsFo2vzXO6gbbOg
代码:
include_once('SimpleHtmlDom.php');
$googleplay = 'https://play.google.com/store/apps/details?id=';
$application = 'com.nolesh.android.livewallpapers.quasar';
$html = $googleplay.$application.'&hl=en_EN';
$html = file_get_html($html);
$screenshots = array();
foreach($html->find('button img[itemprop="image"]') as $screenshot){
//truncate the size parameter from the end of string (=h310)
$pos = strpos($screenshot->src, '=');
$screenshots[] = substr($screenshot->src, 0, $pos);
}
如何解决此问题?
答: 暂无答案
评论