Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't select sibling options #39

Closed
sntran opened this issue Nov 3, 2015 · 2 comments
Closed

Can't select sibling options #39

sntran opened this issue Nov 3, 2015 · 2 comments

Comments

@sntran
Copy link

sntran commented Nov 3, 2015

Test case:

iex> html = "<select><option value=\"foo\">Foo</option><option value=\"bar\">Bar</option><option value=\"barz\">Barz</option></select>"
iex> Floki.parse(html) |> Floki.find("select option + option")
** (ArgumentError) argument error
    :erlang.hd([])
    lib/floki/finder.ex:90: Floki.Finder.traverse_sibling/4
    lib/floki/finder.ex:60: Floki.Finder.traverse/4
    lib/floki/finder.ex:40: Floki.Finder.traverse/4
    lib/floki/finder.ex:56: Floki.Finder.traverse/4
    lib/floki/finder.ex:44: Floki.Finder.traverse/4
    lib/floki/finder.ex:23: Floki.Finder.find/2

Floki version: 0.6.1

philss added a commit that referenced this issue Nov 3, 2015
It fixes sibling node selection when the precendent selector
match an element at the end of sibling list.

Fix [issue #39](#39)
@philss
Copy link
Owner

philss commented Nov 4, 2015

Hi @sntran! Thank you for the report!

It is fixed in the version 0.7.0. Please check that.

@sntran
Copy link
Author

sntran commented Nov 4, 2015

👏 Thank you!

@sntran sntran closed this as completed Nov 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants