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

Error on similar attributes #22

Closed
mrgingles opened this issue Oct 21, 2017 · 3 comments
Closed

Error on similar attributes #22

mrgingles opened this issue Oct 21, 2017 · 3 comments

Comments

@mrgingles
Copy link

Hi!
I found an error when there are similar attributes on the same tag.

If you have src and src2 attribute on an img tag and try to use ->attr('src'), it founds nothing. If you use ->attr('src2') it found the attr text as expected.

@duzun
Copy link
Owner

duzun commented Nov 27, 2017

I've added some unit-tests to prove ->attr('src2') works exactly the same as ->attr('src') or any other attribute.

Please, check you code around hQuery and the HTML sources you are parsing to find the issue!

Regards

@mrgingles
Copy link
Author

Hi @duzun
I can confirm that the problem is not on src2 as attribute, but the problem is that if you have SIMILAR attributes on the same tags (eg. src and src2 - <img src='xxx' src2='yyy'>), hQuery can't get the src value (but it works on src2)

@duzun
Copy link
Owner

duzun commented Nov 27, 2017

My last commit pruves just the opposite!

Can you provide some code example?

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