从命令行运行爬虫会出错

runining a crawler from command line gives an error

当我尝试从 cmd 运行 爬虫时,它给出了这个错误

Error: com.fasterxml.jackson.core.JsonParseException: 
Unexpected end-of-input in field name at 
[Source: java.io.FileInputStream@19f6368; line: 2, column: 2]

我使用的代码

import.ioc.exe -crawl C:\Users\~\Desktop\importCMD\crawler.json C:\Users\~\Desktop\importCMD\auth.json

我已经尝试 运行 宁因为管理员仍然没有工作 "Win8 / 64bit" 并使用最新版本的 import.io

授权 json

{
"userGuid": "88f4ec3c97154c----b833fb4cd9fe0",
"apiKey": "88f4ec3c97154c46829b833----------9badfe87c502e8dc0298d153c4433c577d083afdbfbe8df13d66ec762c5a102edcd849a36b1879b5f0f73787a1f99531c9b66679"

}

爬虫json

    {  
   "cookiesEnabled":false,
   "robotsDisabled":false,
   "canonicalDisabled":false,
   "outputFile":"C:\Users\~\Desktop\import.io CMD\cmd - test.csv",
   "advancedMode":true,
   "connections":3,
   "connectorGuid":"dfb05194-0000-4bbe-b990-302c65875754",
   "pause":1,
   "crawlTemplate":[  
      "https://www.website.com/"
   ],
   "dataTemplate":[  
      "https://www.website.com/{any}/link"
   ],
   "destination":"CSV",
   "maxDepth":0,
   "startUrls":[  
      "https://www.website.com/products/link1",
      "https://www.website.com/products/link2",
      "https://www.website.com/products/link3",
      "https://www.website.com/products/link4",
      "https://www.website.com/products/link5",
      "https://www.website.com/products/link6"
   ],
   "local":false
}    

a JsonParseException 很可能是由于您在 crawler.jsonauth.json

中提供的 json 文件有问题

如果 json 有错误,请尝试将这些文件的内容粘贴到 this website 并点击页面右上角的复选框。它会告诉你它们在哪里。

我遇到了同样的问题。我的平台是windows 7.

如果你从import.io知识库(http://support.import.io/knowledgebase/articles/325728-command-line-crawling)复制auth.json,第二行开头有一个U+FEFF字符。

删除它,您可以 运行 windows 中的抓取工具。