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

select element that has specific text #32

Closed
alireza9402 opened this issue Sep 15, 2015 · 5 comments
Closed

select element that has specific text #32

alireza9402 opened this issue Sep 15, 2015 · 5 comments

Comments

@alireza9402
Copy link

hi!
how i can select a element that has a specific text?

And a suggestion :
in css or jquery when i want select a element with two class i use this syntax .class1.class2
but in your script it doesn't work.i think you choose this syntax for this : .class1+.class2
please fix this.Thank You.

@alireza9402
Copy link
Author

i write this function and add that to Dom.php.
public function findWithText($selector, $text)
{
$this->isLoaded();
$results = $this->find($selector);
$return = new Collection;
foreach($results as $result){
if($result->text == $text){
$return[] = $result;
}
}
return $return;
}

@paquettg
Copy link
Owner

Is there a normal way to do this (selecting elements with text) in css/jquery?

Could you also open another issue with the double class issue. I would like to keep each issue dedicated to a single problem.

Thanks.

@alireza9402
Copy link
Author

no jquery has this syntax $(":contains(text)")

@paquettg paquettg added this to the 1.7 milestone Oct 21, 2015
@paquettg paquettg self-assigned this Oct 21, 2015
@paquettg paquettg removed their assignment Apr 6, 2016
@paquettg paquettg removed this from the 1.7.0 milestone Apr 6, 2016
@paquettg
Copy link
Owner

paquettg commented Apr 6, 2016

I have not been able to get this to work. If some one else can find a solution to this please send me a pull request but I am not able to modify the regex to get this suntax to work, sorry.

@paquettg paquettg closed this as completed Apr 6, 2016
@doncadavona
Copy link

JQuery has this selector syntax:

"a:contains('https://google.com')"

Any alternate way to use the same function meanwhile its not supported yet?

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

No branches or pull requests

3 participants