XPath error
Closed this issue · 1 comments
smithaitufe commented
import SweetXml
SweetXml
iex(2)> doc = "<h1><a>Some linked title</a></h1>"
"<h1><a>Some linked title</a></h1>"
iex(3)> doc |> xpath(~x"//a/text()")
** (UndefinedFunctionError) function :xmerl_scan.string/2 is undefined (module :xmerl_scan is not available)
:xmerl_scan.string('<h1><a>Some linked title</a></h1>', [])
lib/sweet_xml.ex:230: SweetXml.parse/2
lib/sweet_xml.ex:418: SweetXml.xpath/2
iex(3)> doc |> xpath(~x"//a/text()")
smithaitufe commented
I resolved this issue in my linux mint by installing
sudo apt-get install erlang-xmerl
Source: https://chodounsky.net/2015/06/03/elixir-undefined-function-xmerl/