0
chromless apiを使用してフルページのスクリーンショットをキャプチャしたいと思います。 (フルページは、現在のビューポートだけでなく、折りたたみの下のすべてのものと同じように)クロムレスAPIを使用してdocument.body.scrollHeightにアクセスできますか?
ここで私が現在持っているものですが、私は彼らのdemo siteにテストしてい:?
const chromeless = new Chromeless({ remote: true })
const screenshot = await chromeless
.goto('https://www.graph.cool')
.setViewport({width: 1024, height: 800, scale: 1})
.evaluate(() => {
const height = document.body.scrollHeight;
return height
})
.setViewport({width: 1024, height: height, scale: 1})
.screenshot()
console.log(screenshot)
await chromeless.end()
私は(希望は)私のjavascriptのは大丈夫です、そして多分これは、APIの制限だと思うからアクセスdocument
オブジェクトですヘッドレスウェブブラウザ?
は、参考のために、評価のドキュメントです: https://github.com/graphcool/chromeless/blob/master/docs/api.md#api-evaluate