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

Selecting nodes by attribute values #1

Open
GarryGaller opened this issue Aug 3, 2016 · 2 comments
Open

Selecting nodes by attribute values #1

GarryGaller opened this issue Aug 3, 2016 · 2 comments

Comments

@GarryGaller
Copy link

let htmldoc ="""
<html>
<body>
<a href="12345.txt">12345.txt</a>
<a href="12346.txt">12346.txt</a>
<a href="12347">12347</a>
</body>
</html>
"""

echo q(htmldoc).select("a[href=12345.txt]")
#output: @[<a href="12345.txt">12345.txt</a>, <a href="12346.txt">12346.txt</a>, <a href="12347">12347</a>]

let htmldoc2 ="""
<html>
<body>
<a href="12345">12345</a>
<a href="12346">12346</a>
<a href="12347">12347</a>
</body>
</html>
"""

echo q(htmldoc2).select("a[href=12347]") 
#output:  @[<a href="12345">12345</a>, <a href="12346">12346</a>, <a href="12347">12347</a>]

let htmldoc3 ="""
<html>
<body>
<a href="a12345">a12345</a>
<a href="a12346">a12346</a>
<a href="a12347">a12347</a>
</body>
</html>
"""
# Correctly working soon:
echo q(htmldoc3).select("a[href=a12347]")
#output: @[<a href="a12347">a12347</a>]
@ba0f3
Copy link
Collaborator

ba0f3 commented Aug 7, 2016

I will check this soon, just back home from a long vacation

@ghost
Copy link

ghost commented Jul 29, 2017

To anyone, who found this library and wonders if it works: it works

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