-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Xtracter] How do you output multiple matches of an xpath? #3
Comments
Hello. I programmed this script to scrape basic information off of websites. The person who requested this plugin only needed information from a single tag. That's why you'll find the 1f096ad commit should fix this but I haven't tested the code. Please let me know so I can close this issue. Thank you for using my plugin. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lets say you're trying to do
xtract https://ubuntu.com "//h2"
Now, there are 36 matches for //h2 on ubuntu.com, but xtract will only return the first match.
I assumed perhaps the results were separated by a newline character, so I've tried,
re s/\\n/-/gm [xtract https://ubuntu.com "//h2"]
to replace all new lines,\n
, with a dash, and it still only returns the first match.Is there a way to show multiple xpath results with xtract? Am I doing something wrong?
Edit: Trying unions does not return multiple values either.
xtract https://ubuntu.com "//h1 | //title"
only returns the first match//h1
instead of both matches//h1
and//title
in the union.The text was updated successfully, but these errors were encountered: