Extract number from webpage with dynamic selectors!

Hi all

anyone can advise the best way to extract the share price from the following web links, and output as a variable?

https://www.bloomberg.com/quote/VANEMUI:ID

I’ve tried to use anchor base (Find element for the word “USD” + Get OCR text by selecting the element to the left of the USD word) but the execution can be unstable at times. Sometimes it worked, sometimes it throws out “Anchor base faulted” error. I want to minimise exceptions. how to best extract the share price?

Please advise!!

Hi,
It should work fine using the anchor base.In the properties did you give the position?

thanks for replying! I did not give position as i do not how to go about doing that.

Find element properties pane :

Selector for “find element”:

Get OCR Text pane:

which field do i enter for the position? Can you guide me how i can fine-tune my properties pane such that there wont be any exception thrown?

click the anchor base box which surrounds the two activities. There you will find the position in the properties pane.

it shows “right” which means ive already selected it. if thats the case, i shouldnt expect any exception but sometimes it still throws out “anchor base faulted” when i debug

Capture

You have switched the activities. The anchor part is first then the activity next.
Interchange the places of the find element and get OCR activity.

Hi @Chiwfoong

I tried to play on the selector to extract the share price before going to the option of Anchor Base,
so after tuning it I got this selector

<html app='chrome.exe' title='*Bloomberg Mark*' />
<webctrl parentid='root' tag='SPAN' class='priceText*' />

I used it on multiple pages and it still valid.

Regards,
Reda

Hi @reda thank you. I used your selectors for [Get Text] and it works! Thanks!! Just a side question, this will work despite the element not being visible on the screen since it doesnt use Get OCR text and rather it goes by searching for the element right?

thank you. i chekced my uipath screen, my anchor base is “anchor” on the right and "drop action activity " on the left. but still, thanks a lot for helping

Hi @Chiwfoong

Yeah since you’re not using an OCR or an activity that is using the pixels of the elements to read it then you can just go ahead and reduce the page before reading the number and it still going to work.

Regards,
Reda

[Please close thread by marking the right answer as solution for other people to find it easily]