Yuriy

How to click at not first link, if I know only "text"

3 posts in this topic

Hi.

There are several links at page:

<span class="selection-link
normal 
"
  data-selection-line="peq.2"
  data-selection-key="3607582@Tan_{0}__isrus_{1}10.RG_H"
>peq.2</span>

I know only that we need click at "peq.2"  

FF.au3. I create a copy of _FFLinkClick function, and replace "a" to "span". It's work perfectly:  _FFSpanClick ("peq.2", "text"). But it always click at first link with this text. How click at second (third etc) link at page?

Can help:

* In theory I can calculate "data-selection-key" (it's different for every link). But I don't understand how it can help. All "$sMode" for FFLinkClick dosn't work.

* My target link is always first after unique text "(current)":

<div class="name-field" data-ellipsis='{}'> To By First </div>
  </div>
 <table class="td-border table-layout-fixed ">
 
  <tr>
   <th class=""><div data-ellipsis='{}'>ab</div></th>
 <th class=""><div data-ellipsis='{}'>qop</div></th>
 </tr>
 <tr>
 
  <td  class="long " data-pounn-uuid="2018001830-8329874013" data-sel='{"sn":"ab (-1.5)","mn":"To By First","ewc":"1/1 1","cid":8329874013,"prt":"CP","ewf":"1.0","epr":"peq.2","pr":{"0":"2/9","1":"1.222","2":"-450","3":"0.222","4":"0.222","5":"-4.50"}}'
  >
 <div class=" pounn-link-2way
 ">
<div class="pounn-kiren">
 (-1.5)
 </div>
<div class="pounn-line">
  <span class="selection-link
normal 
"
  data-selection-line="peq.2"
  data-selection-key="3607582@To_With_kiren_By_tans.HB_H"
>peq.2</span>
 </div>
</div>
 </td>
   <td  class="long " data-pounn-uuid="2018001823-8329874012" data-sel='{"sn":"poq (+1.5)","mn":"To By First","ewc":"1/1 1","cid":8329874012,"prt":"CP","ewf":"1.0","epr":"pen.3","pr":{"0":"13/4","1":"4.25","2":"+325","3":"3.25","4":"-0.308","5":"3.25"}}'
  >
 <div class=" pounn-link-2way
 ">
<div class="pounn-kiren">
 (+1.5)
 </div>
<div class="pounn-line">
  <span class="selection-link
normal 
"
  data-selection-line="pen.3"
  data-selection-key="3607582@To_With_kiren_By_tans.HB_A"
>pen.3</span>
 </div>
</div>
 </td>
  </tr>
  </table>


....
There are many of similar divs. And my:


<div class="name-field" data-ellipsis='{}'> To igrus, 2nd tan </div>
  </div>
 <table class="td-border table-layout-fixed ">
 
  <tr>
  <th class="width20">
<div  data-ellipsis='{}'>    <span class="result-description-part"> </span>
   </div>
 </th>
   <th class="width40"><div data-ellipsis='{}'>ab</div></th>
 <th class="width40"><div data-ellipsis='{}'>qop</div></th>
 </tr>
 <tr>
  <td data-header-highlighted = "header-highlighted" data-ellipsis='{}' nowrap = "nowrap" 
 class=" text-align-left  width20">
 <span class=mirkja-table-name>igrus <b>1</b></span>
  <span>(current)</span>  <span class="result-description-part"> <span
class="red">(<img class="sport-icon-image" src="
 https://web.site.org/images/kong.png
"/>0:0)</span></span> </td>

  <td  class="long width40" data-pounn-uuid="-1618243641-8329873321" data-sel='{"sn":"ab To","mn":"tan 2, igrus 1","ewc":"1/1 1","cid":8329873321,"prt":"CP","ewf":"1.0","epr":"peq.2","lines":{"0":"17/50","1":"1.34","2":"-294","3":"0.34","4":"0.34","5":"-2.94"}}'
  >
 <div class=" pounn-icon
 ">
<div class="pounn-kiren">
  </div>
<div class="pounn-line">
  <span class="selection-link
normal 
"
  data-selection-line="peq.2"
  data-selection-key="3607582@tan_{0}__igrus_{1}10.RG_H"
>peq.2</span>
 </div>
</div>
 </td>
   <td  class="line width40" data-pounn-uuid="-1618243648-8329873327" data-sel='{"sn":"poq To ","mn":"tan 2, igrus 1","ewc":"1/1 1","cid":8329873327,"prt":"CP","ewf":"1.0","epr":"pen.3","lines":{"0":"23/10","1":"3.30","2":"+230","3":"2.30","4":"-0.435","5":"2.30"}}'
  >
 <div class=" pounn-icon
 ">
<div class="pounn-kiren">
  </div>
<div class="pounn-line">
  <span class="selection-link
normal 
"
  data-selection-line="pen.3"
  data-selection-key="3607582@tan_{0}__igrus_{1}10.RG_A"
>pen.3</span>
 </div>
</div>
 </td>
  </tr>

 

Share this post


Link to post
Share on other sites



I would suggest using _FFXpath to find the desired element and then _FFClick to click on it.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks!

1. I install firebug to watch element's XPath

2. _FFClick (_FFXpath (".//*[@id='block4063321type111']/div[4]/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/span"))   Work as I need.

"type111" - is marker of my element.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now