philss / floki

Floki is a simple HTML parser that enables search for nodes using CSS selectors.
https://hex.pm/packages/floki
MIT License
2.07k stars 156 forks source link

Feature Request: XPath selectors #94

Open liveresume opened 7 years ago

liveresume commented 7 years ago

It would be great to support XPath selectors.

Looks like https://github.com/expelledboy/exml gives us a head start.

What are your thoughts?

philss commented 7 years ago

Hi @liveresume!

TLDR: I think it's a good idea, but I prefer to have a separated lib/package for it.

I want to have xPath selectors, but I'm not sure if in this project or somewhere else that can be pluggable (like a floki-xpath project). This is because I want to keep the API as simple as possible. There is also another point that is implicit today: I'm only supporting HTML in Floki. With xpath we would have a bit of XML in the project. I'm not sure if I want to support that too.

Thank you! I will leave this open and think more about. If you have suggestions, please leave comments here.

ghalestrilo commented 11 months ago

@philss this one's still open - can I ask what the plan is around support for this feature? Does a separate repo exist, will it be added to floki or discarded altogether?

philss commented 11 months ago

Does a separate repo exist, will it be added to floki or discarded altogether?

@ghalestrilo not, I don't think there is something out there. But I wish someone could implement this. It could be inside Floki, having a good API that separates from the default CSS selectors.

ghalestrilo commented 11 months ago

NIce. Happy to take a look once I have some time