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

Add JSONPath support #204

Open
Gallaecio opened this issue Nov 17, 2020 · 4 comments
Open

Add JSONPath support #204

Gallaecio opened this issue Nov 17, 2020 · 4 comments

Comments

@Gallaecio
Copy link
Member

From @Granitosaurus at #25 (comment):

Not to derail this but I'd argue that implementing JSONpath[1] would actually be more fitting for parsel as it is xpath like. For example Jmespath doesn't support recursive queries (like //node xpath) while Jsonpath does (as $..node); also the whole protocol structure is much more similar to that of xpath.

Ideally it would be great to have both! More and more web is using json and would be great to have one good parser for both html and json.

1 - https://github.com/h2non/jsonpath-ng jsonpath implementation in Python

@Gallaecio Gallaecio changed the title Add JSONpath support Add JSONPath support Nov 17, 2020
@Granitosaurus
Copy link

I could add jsonpath support when/if #181 gets merged.

@deepakdinesh1123
Copy link
Contributor

Should adding support for JSONPath be put on hold until #181 gets merged or can I work on it right now?

@Gallaecio
Copy link
Member Author

I think it should wait, because #181 paves the way making internal changes needed for it.

It could be implemented cherry-picking those internal changes. And if someone wants to push JSONPath to be implemented as soon as possible, I am OK with that approach.

@EchoShoot
Copy link
Contributor

I think Jmespath should be supported first, because it has been actively maintained over the years, and has plenty of resources and documentation. Many developers can find a way to get started. Then we can wait for a better and more robust json parser to appear. This doesn't conflict, just like css doesn't conflict with xpath, both are supported by parsel at the same time.

@Gallaecio Gallaecio mentioned this issue Jun 27, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants