Cannot click on a link that have href='javascript:doPage'

The Report on the application, has Pagination.
The goal is to scrap data from each page.

Pagination links have following stricture
//href=“javascript:doPage(1);”
//href=“javascript:doPage(2);”
//href=“javascript:doPage(3);”
etc.

The solution should be simple.
{
“Command”: “click”,
“Target”: “//a[@href=‘javascript:doPage(1);’]”,
“Value”: “”,
“Description”: “”
}
However, the click in visible on a screen, but next page is not displayed.
See recording

I have trayed deferent approaches, non is working

{
  "Command": "store",
  "Target": "2",
  "Value": "link_position",
  "Description": ""
},
{
  "Command": "XClick",
  "Target": "//a[@href=\"javascript:doPage(${link_position});\"]",
  "Value": "",
  "Description": ""
},
{
  "Command": "click",
  "Target": "//a[@href=\"javascript:doPage(${link_position});\"]",
  "Value": "",
  "Description": ""
},
{
  "Command": "click",
  "Target": "//a[contains(@href, 'javascript:doPage')][${link_position}]",
  "Value": "",
  "Description": ""
},
{
  "Command": "click",
  "Target": "//tr[@class=\"pagging_header\"]//a[${link_position}]",
  "Value": "",
  "Description": ""
},
{
  "Command": "clickAndWait",
  "Target": "linkText=${link_position}",
  "Value": "",
  "Description": ""
}

Try XClick instead of Click, that should solve it.

25 “xCommands” limit per day for non payed UIV version.
The frame work servicing 1500 clients. The boss do not willing to pay :pensive:

I think UIV is very well worth the money, but if you can not afford it right now, see this post for a workaround for unlimited xclicks in the free version:

its 25 per macro run

1 Like

Well, it do not help me much
i am scraping data from reports for same User.
Reports may have hundreds of pages

try javascript click

can u please give an example

read javascript DOM click () method
example

document.getElementById('elementID').click();

well, i have tried it. It is not working for us.
The reports are very old and purely designed. The element do not have id or name
only “href”

<tr class="pagging_header">
  <td colspan="11" align="right">
	  <a href="javascript:doPage(1);">First</a> 
	  <a href="javascript:doPage(2);">2</a> 
	  <a href="javascript:doPage(3);">3</a> 
	  <a href="javascript:doPage(4);">4</a> 
	  <a href="javascript:doPage(5);">5</a> 
	  <a href="javascript:doPage(6);">6</a>
  </td>
</tr>

var x= document.getElementsByTagName(“a”);
x[0].click();

this is just an example

you have to first get tag TR and then loop through tag A

you can get to TR using getElementsByClassName