【问题标题】:PhantomJs renderingPhantomJs 渲染
【发布时间】:2017-09-11 11:59:58
【问题描述】:

从 phantomJs 渲染文件名的字符数是否有限制?

var page = require('webpage').create();
page.open('http://github.com/', function() {
      window.setTimeout(function(){
      var filename = encodeURI('The code shown here is also available in various examples included with PhantomJS. You are also recommended to explore the use of PhantomJS for page automation, network monitoring, screen capture, and headless testing The code shown here is also available in various examples included with PhantomJS. You are also recommended to explore the use of PhantomJS for page automation, network monitoring, screen capture, and headless testing');
      console.log('filename: ' + filename);
      page.render(filename + ".png");
      phantom.exit();}, 100);
});

此文件未通过 phantomJs 进行渲染。

有人可以帮忙吗?

【问题讨论】:

  • 为什么不自己了解一下限制呢?

标签: phantomjs


【解决方案1】:

我认为这与 PhantomJS 无关,但基本上与您的操作系统有关。每个操作系统的文件路径名都有大小限制。

根据naming convention in Windos OS-

在 Windows API 中(下面将讨论一些例外情况 段落),路径的最大长度为 MAX_PATH,即 定义为 260 个字符。本地路径的结构如下 顺序:驱动器号、冒号、反斜杠、名称组件以分隔 反斜杠和终止空字符。例如, 驱动器 D 上的最大路径是“D:\some 256-character path string” 其中“”表示不可见的终止空字符 当前系统代码页。 (字符 在这里用于 视觉清晰,不能成为有效路径字符串的一部分。)

【讨论】:

    猜你喜欢
    • 2014-12-09
    • 1970-01-01
    • 2016-11-21
    • 2014-12-20
    • 2023-04-03
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    • 2017-01-12
    相关资源
    最近更新 更多