无法在Elixir中使用Hound加载页面

时间:2016-10-21 06:35:33

标签: elixir headless-browser hound

我正在尝试请求页面并检查它但我得到了:

** (exit) exited in: GenServer.call(Hound.SessionServer, {:change_session0.100.0>, :default, []}, 60000)
** (EXIT) an exception was raised:
 ** (MatchError) no match of right hand side value: {:error, :econnrefused}

            (hound) lib/hound/session_server.ex:78: Hound.SessionServer.hall/3

我的代码:

Hound.start_session
Hound.Helpers.navigate_to("http://example.com")
Hound.end_session

它出了什么问题?

1 个答案:

答案 0 :(得分:-1)

defmodule的正下方,您需要添加行use Hound.Helpers

然后您的代码应如下所示:

Hound.start_session

navigate_to('www.website.com')

Hound.end_session