-
Notifications
You must be signed in to change notification settings - Fork 2
/
phantomjs achieve free online web screenshot tool - toolfk online Programmer toolbox
78 lines (50 loc) · 5.78 KB
/
phantomjs achieve free online web screenshot tool - toolfk online Programmer toolbox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
This paper to recommend \[ToolFk\] is a programmers often use a free online test kit, ToolFk feature is focused on everyday programmer development tools, without having to install any software, as long as the content execution affixed by a button, able to obtain the contents of the desired results.ToolFk also supports [BarCode Barcode generated online ](https://www.toolfk.com/tool-generator-barcode "BarCode Barcode generated online"), [QueryList collector ](https://www.toolfk.com/tool-run-reptile "QueryList collector"), [PHP code is run online ](https://www.toolfk.com/tool-online-runphp "PHP code online operation"), [PHP confusion, encryption, decryption ](https://www.toolfk.com/tool-convert-php "PHP confusion, encryption, decryption"), [Python code is run online ](https://www.toolfk.com/tool-online-runpython "Python code runs online"), [JavaScript online operation ](https://www.toolfk.com/tool-online-runjs "JavaScript online operation"),[YAML formatting tools](https://www.toolfk.com/tool-format-yaml "YAML formatting tools") , [HTTP simulation query tool ](https://www.toolfk.com/tool-online-http "HTTP query tool simulation"), [HTML online toolbox ](https://www.toolfk.com/tool-format-html "HTML Online Toolbox"), [JavaScript online Toolbox ](https://www.toolfk.com/tool-format-javascript "JavaScript toolkit online"),[CSS online toolbox ](https://www.toolfk.com/tool-format-css "CSS Online Toolbox"), [JSON online toolbox ](https://www.toolfk.com/tool-format-json "JSON Online Toolbox"), [unixtime timestamp conversion ](https://www.toolfk.com/tool-convert-unixtime "Unixtime timestamp conversion"), [Base64 / the URL of / native2ascii conversion ](https://www.toolfk.com/tool-encdec-transform "Base64 / URL / Native2Ascii conversion"), [CSV conversion kit ](https://www.toolfk.com/tool-convert-csv "CSV Converter Toolkit"), [XML online toolbox ](https://www.toolfk.com/tool-format-xml "XML Online Toolbox"), [the WebSocket online tools ](https://www.toolfk.com/tool-online-runwebsocket "WebSocket online tools"), [Markdown online toolbox ](https://www.toolfk.com/tool-convert-markdown "Markdown Online Toolbox"), [Htaccess2nginx conversion](https://www.toolfk.com/tool-convert-htaccess2nginx "Htaccess2nginx conversion"), [Hex conversion online ](https://www.toolfk.com/tool-convert-hexadecimal "Online hex conversion"), [online encryption toolkit ](https://www.toolfk.com/tool-convert-encryption "Online Encryption Toolkit"),[online pseudo-original tools ](https://www.toolfk.com/tool-convert-text "Online pseudo-original tool"), [online APK decompile ](https://www.toolfk.com/tool-decompile-apk "Online APK decompile"), [online web screenshot tool ](https://www.toolfk.com/tool-screen-captures "Online web screenshot tool"), [online random password generation ](https://www.toolfk.com/tool-password-generator "Online Random Password Generator"), [online generate two-dimensional code qrcode ](https://www.toolfk.com/tool-generate-qrcode "Online generated two-dimensional code Qrcode"), [online Crontab Expression Builder ](https://www.toolfk.com/tool-generate-crontab "Online Crontab Expression Builder"),[the online short URL Generator ](https://www.toolfk.com/tool-short-url "Online Short URL Generator"), [Online calculator tool ](https://www.toolfk.com/tool-game-calculator "Online calculator tool"). And more than 20 daily programmer development tools, can be considered a very comprehensive website programmer's toolbox.
Site name: ToolFk
website links: [https://www.toolfk.com/](https://www.toolfk.com/)
Tools link: [https://www.toolfk.com/tool-screen-captures](https://www.toolfk.com/tool-screen-captures)
Teaching Code
-------------
This tool \[online? Website screenshot tool\]?-Dependent code library phantomjs library.https://github.com/ariya/phantomjs
STEP 1
[![](https://4.bp.blogspot.com/-V3suH4_fDFM/XA8txPH35pI/AAAAAAAAAGA/dlN7dpYLlnY8y5DylPkHLPuYBtl5454CACPcBGAYYCw/s1600/screen.png)](https://4.bp.blogspot.com/-V3suH4_fDFM/XA8txPH35pI/AAAAAAAAAGA/dlN7dpYLlnY8y5DylPkHLPuYBtl5454CACPcBGAYYCw/s1600/screen.png)
STEP 2
? THE CORE CODE IS AS FOLLOWS
```
var page = require ( 'webpage'). create (),
system = require ( 'system'),
url, filename, visitType, ratio;
url = system.args [1];
filename = system.args [2];
visitType = system.args [3];
ratio = system.args [4];
//console.log(JSON.stringify(page.viewportSize));
page.open (url, function (status) {
if (status! = "success") {
console.log ( 'FAIL to load the address');
phantom.exit ();
}
if (visitType == 1) {
switch (ratio) {
case "0": page.viewportSize = {width: 1920, height: 1080}; break;
case "1": page.viewportSize = {width: 2560, height: 1440}; break;
case "2": page.viewportSize = {width: 1680, height: 1050}; break;
case "3": page.viewportSize = {width: 1440, height: 900}; break;
case "4": page.viewportSize = {width: 1280, height: 1024}; break;
case "5": page.viewportSize = {width: 1024, height: 768}; break;
default: page.viewportSize = {width: 1920, height: 1080};
}
}
});
page.onLoadFinished = function () {
page.render (filename);
page.close ();
phantom.exit ();
};
```
It is worth a try for three reasons:
------------------------------------
1. Integrate various programmers often used in development and testing tools.
2. Simple and beautiful atmosphere of the site pages
3. Online support formatting code execution, APK online decompile, online high-strength password generator, two dozen screenshots online web tools service
4. Also recommend its sister network [www.videofk.com](http://www.videofk.com/) video download Toolbox
> This link: [http://www.hihubs.com/article/380](http://www.hihubs.com/article/380)