当前位置:网站首页>[软件] phantomjs屏幕截图
[软件] phantomjs屏幕截图
2022-07-01 07:18:00 【违规账号247188】
下载应用phantomjs-2.1.1-windows,解压压缩包
在bin路径下面,创建.txt,复制下面,保存,文件名改为demo.js
切换到bin路径下进入CMD
在CMD运行 phantomjs.exe demo2.js
var page = require('webpage').create();
//viewportSize being the actual size of the headless browser
page.viewportSize = { width: 1770, height: 750 };
//the clipRect is the portion of the page you are taking a screenshot of
page.clipRect = { top: 0, left: 0, width: 1770, height: 750 };
//the rest of the code is the same as the previous example
page.open('http://220.160.53.33:8903/case/sz22058', function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit();
} else {
window.setTimeout(function () {
page.render('肿瘤成绩.png');
phantom.exit();
}, 200); // Change timeout as required to allow sufficient time
}
});
边栏推荐
- Redisson uses the full solution - redisson official documents + comments (Part 2)
- 微软宣布开源 (GODEL) 语言模型聊天机器人
- [programming compulsory training 3] find the longest consecutive number string in the string + the number that appears more than half of the times in the array
- Summary of the concept and advantages of 5g massive MIMO
- 【MATLAB】求解非线性规划
- LeetCode+ 71 - 75
- 如何制作专属的VS Code主题
- 电脑有网络,但所有浏览器网页都打不开,是怎么回事?
- Fix the problem that the AI video intelligent platform easycvr device video cannot be played
- Pourquoi tant de gens sont - ils devenus des gestionnaires de produits? Quelles sont les perspectives de développement des gestionnaires de produits?
猜你喜欢
随机推荐
[lingo] find the shortest path problem of undirected graph
【LINGO】求七个城市最小连线图,使天然气管道价格最低
【深圳IO】精确食品称(汇编语言的一些理解)
【Tikhonov】基于Tikhonov正则化的图像超分辨率重建
kdtree(kd树)笔记
Mysql与Redis一致性解决方案
C language implementation [Sanzi chess game] (step analysis and implementation source code)
Inventory the six second level capabilities of Huawei cloud gaussdb (for redis)
Vscode automatically formats code according to eslint specification
Kdtree notes
ctfshow-web352,353(SSRF)
广发证券开户是安全可靠的么?怎么开广发证券账户
Subclasses call methods and properties of the parent class with the same name
STM32F1与STM32CubeIDE编程实例-NEC协议红外接收与解码
Microsoft announces open source (Godel) language model chat robot
AI视频智能平台EasyCVR设备录像出现无法播放现象的问题修复
2022制冷与空调设备运行操作国家题库模拟考试平台操作
Why did grayscale fall from the altar?
[image processing] image histogram equalization system with GUI interface
[target detection] yolov5, the shoulder of target detection (detailed principle + Training Guide)