【发布时间】:2017-02-02 12:50:13
【问题描述】:
我正在尝试使用 wget 命令将页面的源返回到使用命令的字符串:
val url: String = "https://morningconsult.com/alert/house-passes-employee-stock-options-bill-aimed-startups/"
import sys.process._
val result: String = ("wget -qO- " + url !).toString
println("result : " + result);
但返回值为0。这是代码的输出:
result : 0
如何访问变量中wget的返回值,这里是url的源值?
【问题讨论】: