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

element.find_by_text searches whole dom #612

Closed
jaraco opened this issue May 13, 2018 · 3 comments
Closed

element.find_by_text searches whole dom #612

jaraco opened this issue May 13, 2018 · 3 comments
Labels
Milestone

Comments

@jaraco
Copy link
Contributor

jaraco commented May 13, 2018

When trying to do a contextual search for text, the result returned includes all matching text for the whole DOM instead of just those nodes that are children of the contextual node.

@jaraco
Copy link
Contributor Author

jaraco commented May 13, 2018

I believe the issue lies here.

The //* means all nodes in dom. It should be .//* to mean all child nodes.

@andrewsmedina
Copy link
Member

@jaraco this line is the browser.find_by_text and in this case the code is right. I believe that the bug is here in the element.find_by_text:

selector = '//*[text()="%s"]' % text

@jaraco
Copy link
Contributor Author

jaraco commented May 25, 2018

Yes. That makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants