 
   defp find_by_selector(_selector, {}, _, acc), do: acc
   defp find_by_selector(_selector, [], _, acc), do: acc
+  defp find_by_selector(_selector, _, _, {:done, nodes}), do: {:done, nodes}
   defp find_by_selector(_selector, tree, _, acc) when is_binary(tree), do: acc
   defp find_by_selector(selector, [h|t], matcher, acc) do
     acc = find_by_selector(selector, h, matcher, acc)


  defp class_matcher(class_name, node, acc) do
    { _, attributes, _ } = node

    if attribute_match?(attributes, "class", class_name) do
      acc = [node|acc]
    end

    acc


  defp id_matcher(id, node, acc) do
    { _, attributes, _ } = node
    { :ok, acc_nodes } = acc

    if attribute_match?(attributes, "id", id) do
      acc = {:done, [node|acc_nodes] }
    end

    acc
