Solved

Using + in a selector doesnt work?

  • 9 February 2021
  • 5 replies
  • 40 views

<div>
<span for="afterEvent.embeddedPlayer" class="inputLabelAboveField">Youtube / Vimeo Embed Code</span>
<textarea title="Youtube / Vimeo Embed Code" class="text height_of_3_rows"></textarea>
</div>

Attempting to select the textarea element (it appears 3 times on the same page but each for different purposes). The span element above has the unique “for” attribute so I was trying to use that as a way to target. I’ve tried the following selectors...Neither of which worked. Does the + selector method not work?

[for ="afterEvent.embeddedPlayer"] + [title ="Youtube / Vimeo Embed Code"]

[for ="afterEvent.embeddedPlayer"] + textarea.text

 

Another example

<div>
<div id="digital-event-content-box-after-event" class="border mb-1 digital-event-content-box pointer">
<canvas width="433" height="232" style="width: 734px; height: 394px;"></canvas>
</div>
<div class="mt-2">
<a class="link pointer">Launch content Editor</a>
</div>
</div>


Same situation as above, I’m targeting the link element (but this element appears 3x on the same page but for different purposes). 

#digital-event-content-box-after-event + div > a.link 

This selector showed “Strong” and “1” matched element but did not ultimately work during testing

 

icon

Best answer by shireesha_reddy 24 February 2021, 02:35

Hi @leslietou ,

The Plus sign will not work in the product mapper, Because the plus sign means “find the element immediately following this other element” and we don’t send all the siblings up to the server as part of the click event, we would only know about the clicked element, not the sibling.
So, I would suggest you to check for another possibility to map the elements. 

View original

5 replies

Userlevel 7
Badge

@link_black@dileepnalla@shireesha_reddy is this anything you can help with?

Userlevel 6
Badge

Hi @leslietou ,

The Plus sign will not work in the product mapper, Because the plus sign means “find the element immediately following this other element” and we don’t send all the siblings up to the server as part of the click event, we would only know about the clicked element, not the sibling.
So, I would suggest you to check for another possibility to map the elements. 

@shireesha_reddy Thanks for your reply! Do you have an official list of selectors that are supported?

Userlevel 7
Badge

@Divya and @Rohit S do we have any articles for this?

@Chandu, @shireesha_reddy and @link_black your reply is appreciated. 

Userlevel 7
Badge

I believe we implement the Jsoup package for CSS Selectors.

Reply