Control UI within Chrome

Post your questions and help other users.

Moderator: Martin

Post Reply
robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Control UI within Chrome

Post by robchoc » 18 Dec 2018 09:41

I have a website "Bing rewards" that I'm automating to earn Microsoft points.
I have figured out how to do searches using Bing Rewards app, Edge browser app and Chrome desktop mode search on the webpage.

Image


The only thing left that I'm not sure how to do is to click a URL on the website further down the page.

Example of the URL on the website:

Image

I need to click on the blue 10 points to get my next lot of points.


Any pointers, please?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Control UI within Chrome

Post by Desmanto » 18 Dec 2018 16:31

That is the difficult part. Working with browser webframe is almost impossible. If the element is shown on constant x,y coordinate, you can try to use touchGesture() to simulate the tap (only for NG 7.0+). Other method require root, using input x, y command.

Better solution is using HTTP request and mimic the browser activity. But it is a tremendous task to do, as we need to parse the response using regex, and doesn't guaranteed to work all the time.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Control UI within Chrome

Post by robchoc » 18 Dec 2018 16:58

I'm willing to learn. :idea: :D

I can get the element if I look at the source code on the PC:

Code: Select all

<ng-transclude class="x-hidden-focus"> 10 points </ng-transclude>
How would I make it think I clicked on it?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Control UI within Chrome

Post by Desmanto » 19 Dec 2018 16:41

Find the part which has the link, usually has href or url tag around that. But sometimes the action is linked to another function of javascript somewhere in the source. You have to find it.
The other way to do it is to use Chrome developer tab. Press F12, go to Network tab. Hit reload or do any of the login or clicking and see what happen there. Usually the link visited is located in XHR tab. Find the url and the post data form or any header that has readable data.

I am currently also creating a similar flow, but to query my carrier balance and internet quota. Already planned to do it from months ago, but just started today. I might try to use that as example to explain it. But I haven't finished it yet, there are still last point of the changing number which I don't understand why it won't work. For yours, it will be totally different, but at least you can use the logic to do similar things.

Edit : I sorted out it already. Now have completed the check. Need to tweak the regex to remove some unnecessary data. Still need to rearrange the concept to a good stuctured flow.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply