Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:08:27+00:00 2026-05-26T00:08:27+00:00

for example, given the text of a link, retrieve the hole link element. I

  • 0

for example, given the text of a link, retrieve the hole link element.

I tried this:

$page = $this->getSession()->getPage();
$page->find('content', 'Italiano');

But it says:

Selector “content” is not registered.

EDIT: after check the links of the everzet’s answers I have this:

$el = $page->find('named', array(
        'content', $this->getMainContext()->getSession()->getSelectorsHandler()->xpathLiteral('Pound')));

$el->click();

but I’m getting this error about click() function:

When I choose "Pound sterling" #

MyFirm\FrontendBundle\Features\Context\CurrencyControllerContext::iChoose()

error:_click(_byXPath(“(//html/./descendant-or-self::*[contains(normalize-space(.),
‘Pound’)])[1]”))
TypeError: parent.tagName is undefined
([object
HTMLHtmlElement],”A”,1)@http://myfirm.localhost/s/spr/concat.js:3286
([object
HTMLHtmlElement],”A”)@http://myfirm.localhost/s/spr/concat.js:3762
([object
HTMLHtmlElement])@http://myfirm.localhost/s/spr/concat.js:331
([object HTMLHtmlElement],false,false,(void
0))@http://myfirm.localhost/s/spr/concat.js:708
([object
HTMLHtmlElement])@http://myfirm.localhost/s/spr/concat.js:478
()@http://myfirm.localhost/s/spr/concat.js:3016
()@http://myfirm.localhost/s/spr/concat.js:3016
@http://myfirm.localhost/s/spr/concat.js:2822

  <a

href=’/s/dyn/Log_getBrowserScript?href=null&n=3286’>Click for
browser script

This is the beginning of the output of var_dump($el):

object(Behat\Mink\Element\NodeElement)#438 (2) {
  ["xpath":"Behat\Mink\Element\NodeElement":private]=>
  string(74) "(//html/./descendant-or-self::*[contains(normalize-space(.), 'Pound')])[1]"

And the output of $el->getTagName() is ‘html’.

Is that because I’m trying to click something that is not an element but just content? In that case, any way to get the element from the content?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:08:28+00:00Added an answer on May 26, 2026 at 12:08 am

    Don’t use content selector. Because in almost any case it will provide results, that you don’t expect. For example, when you’re doing content(Pound), you’re expecting that it’ll return you an element, that contains this text. The reality is, every parent element of target one is containing your “Pound” text, including <html/>. That’s why you get <html/> at the end 😉

    Minks selectors are well-explained in the manual:

    • http://mink.behat.org
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this example: <img class=a /> <img /> <img class=a /> <img class=a id=active
Given the email address: Jim <jim@example.com> If I try to pass this to MailAddress
Given a class, org.eclipse.ui.views.navigator.ResourceNavigator for example, how do I find out which jar file
Given the php code: $xml = <<<EOF <articles> <article> This is a link <link>Title</link>
I checked out the example given on http://naghsheh.info/Pivot/Pivot.htm and tried to get it work
Given the following HTML structure: <div id=wrapper> <div id=top> <a href=http://example.com class=link>click here</a> </div>
Given the following HTML structure: <div class=wrapper> <div class=top> <a href=http://example.com class=link>click here</a> </div>
Given an example of calling two web services methods from a session bean, what
Given the following example, why do I have to explicitly use the statement b->A::DoSomething()
Given the following simple example: List<string> list = new List<string>() { One, Two, Three,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.