我使用此方法将html转换为png,并且它总是抛出错误“页面加载超时”,我不知道哪里出错了,请帮助我,非常感谢!
$jpg = $webshot
->setUrl('https://baidu.com/')
->setWidth(1200)
->setHeight(800)
->setTimeout(45) // set timeout in seconds, 30 seconds default
->setFullPage(false) // set to true to get full page screenshot (width/height will be used for viewport only)
->waitForImages() // wait when all images will load
->setImagesLoadingTimeout(180) // images loading timeout, will failt if not loaded
->saveToPng('baidu_full', 'myimages/');