Eltal
October 28, 2022, 2:25pm
#1
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": ""
}
ulrich
November 9, 2022, 6:44pm
#2
Try XClick instead of Click, that should solve it.
Eltal
November 9, 2022, 8:45pm
#3
25 “xCommands” limit per day for non payed UIV version.
The frame work servicing 1500 clients. The boss do not willing to pay
ulrich
November 11, 2022, 8:41pm
#4
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:
To bypass this limit you can close and reopen browser periodically to reset the amount of Xclick/Xtype used.
Eltal
November 14, 2022, 1:30pm
#6
Well, it do not help me much
i am scraping data from reports for same User.
Reports may have hundreds of pages
Eltal
November 16, 2022, 7:18pm
#8
can u please give an example
uiuser
November 16, 2022, 9:31pm
#9
read javascript DOM click () method
example
document.getElementById('elementID').click();
1 Like
Eltal
November 16, 2022, 9:52pm
#10
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>
uiuser
November 17, 2022, 7:51am
#11
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
Eltal
January 3, 2023, 4:32pm
#12
@admin This issue is not present in UIV v2.2.8.
Please advise. i have trayed all work arounds that have been subjected.
Non working on our portal.
admin
January 3, 2023, 9:10pm
#13
But with XClicks it works, or?
Eltal
January 3, 2023, 9:38pm
#14
click/xClick with xPath / CSS is not working
I am not able to use getElementsByName or getElementsByClassName, the tag do not have ‘id’ or ‘name’ attributes.
I am was not able to get the solution proposed by @uiuser work.
look like i will have to try to revert to a UIV v6.2.8
uiuser
January 4, 2023, 6:37am
#15
try with querySelector()
or querySelectorAll()
Eltal
January 4, 2023, 4:16pm
#16
thanks for reply, but i am not sure how to do it.
any tutorial that i can look into?
uiuser
January 4, 2023, 7:54pm
#17
Eltal:
"pagging_header
var x = document.getElementsByClassName("pagging_header")[0].getElementsByTagName("a");
alert (x.length);
run this in chrome console and tell the output
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Eltal
January 5, 2023, 8:35pm
#18
it is not a problem to run it in console as a JS.
I know how.
I need to be able to use this JS in UIVision Click
1 Like
uiuser
January 5, 2023, 9:12pm
#19
<html>
<body>
<a href="https://www.youtube.com/" target="_blank">youtube</a>
<br>
<a href="https://www.google.com/" target="_blank">google</a>
</html>
</body>
{
"Command": "executeScript",
"Target": "document.getElementsByTagName(\"a\")[0].click();",
"Value": "",
"Description": ""
}
}
2 Likes
Eltal
January 5, 2023, 9:23pm
#20
oh, thanks, will try next week,