Issue with Dynamic Selectors in UiPath – Farmacias Galeno Website

Problem Description

I’m experiencing issues with unstable selectors when trying to extract data from the Farmacias Galeno website (https://farmaciasgaleno.com.gt/). The main problem is that the selectors change dynamically when searching for different medications, causing UiPath to fail when trying to locate elements.

Website Interface and Behavior

  • The webpage does not display all information immediately; I need to scroll down to view prices, stock, and pharmacy details.
  • The structure of the page shifts depending on the medication searched. For example, the position of the pharmacy name, price, and stock information may appear at different heights or locations in the DOM.
  • When testing with a specific medicine, the automation works. However, when searching for a different medication, the selectors break, and UiPath throws errors like:
    • “Get Attribute ‘FARMACIAS GALENO’: Multiple similar matches found.”
    • “Find Element ‘B’: Activity timeout exceeded.”

Solutions I Have Tried

I have attempted several strategies to make the selectors more stable:

  1. Dynamic Selectors
  • I tried making the selectors dynamic by using wildcards (* and ?), but they still break when changing medications.
  1. Anchor Base
  • I tried using Anchor Base to find elements relative to a fixed label (like “Pharmacy” or “Price”), but the layout changes prevent consistent detection.
  1. Find Children
  • I attempted to use Find Children to retrieve all similar elements and filter the correct one, but the structure changes in different searches, making it difficult to extract reliable data.
  1. OCR and Text Recognition
  • I attempted to extract the data using Get OCR Text, but the text formatting makes it difficult to extract structured information.

What I Need Help With

I need a reliable way to extract pharmacy details, stock availability, and price from this website, considering that:
:white_check_mark: The page structure shifts depending on the medication.
:white_check_mark: The data is not always visible at first (requires scrolling).
:white_check_mark: The selectors change dynamically, breaking the automation.

Any guidance on handling this situation effectively in UiPath would be greatly appreciated!

I am in the home page. How do I got to the details/page that you have shown in the screenshot?

1 Like

https://farmaciasgaleno.com.gt/Productos/Detalle/MTAxNDk1MA==
this is the link to the screenshot

What details are you trying to fetch?
The one on the left, or right? If it is the Product details on the rigjt (as per your screenshot), I am not able to see those details. I waited for the page to load, and I’ve scrolled.

Yes, they are the details on the right below the product image, I need the name and price

another link
https://farmaciasgaleno.com.gt/Productos/Detalle/MTAxNTkwOQ==

I assume that this website is specific to your country, or it has restricted me from seeing the details.
I have inspected the page and found the element you wish to fetch the details from, but it does not hold any value. (Refer below Screenshot)

I had to manually insert values to verify, as you can see below.

I don’t think I can help you with the selectors if there is nothing to select. Might have to wait for an MVP or another community member who can actually see the details.

I understand, I really appreciate your help, I hope someone can visualize the page well and can help me.

I was checking the page and the links and the prices are not visible, you can only see them if you enter and search directly for the medication

https://farmaciasgaleno.com.gt/



I am also not able to load the page

But with the explanation - I believe the issue could be solved if you use strict selector instead of fuzzy selector

Try to capture the element in active accessibility mode and unselect fuzzy selector. Try only with Strict Selector

let me know your feeedback

Hi @Karla_Cristina_Santos_Cam

Thanks for this critical info.
I tried to build the process with 5 products and found out that the “eye” button plays a key role on the “visibility” of the details.

Explanation:

  1. When I open the link on the browser for the first time, the details are not visible (Like Yesterday).
  2. I search for a medicine and click the “eye”, the details will be visible. But there is a catch.
  3. The Website will display the details of only 1 medicine at a time. Example: I clicked the visibility for “Paracetamol”. You can see below, the details are visible but if I search for “Montelukast” (using URL), it will have the details of “Paracetamol”. This means that “URL based search” is not possible.


  1. You Must search for the medicine on the search bar, click visibility, and then go to that URL/Tab. This must be done for each medicine.

  2. This will solve the Visibility issue.

As for the Selectors Issue:
I have found out that the following details are present on the page:

Based on the type of medicine, the details will be visible. (Because medicines could be fluid, tablet, capsule, injection, etc and hence the details will also vary. For Example, some medicines strictly require Prescriptions, hence this detail will not be present on all medicines). I have selected 5 different medicines to demonstrate the same.

What Did I Do ?

  • Use “Check App State”, to check whether medicine Code (detailcode) is visible. I have done the following under the “Target appears” sequence.
  • Use “Get Attribute” activity for each of the data you wish to extract.
    – Set “Continue On Error” to True. (if the detail is not present for that medicine)
    – Set “Timeout” to 2.
    – Attribute being fetched “visibleInnerText”.
    – In the “Get Attribute” use Strict selectors Only. Use the “id” of the element (As shown in my excel column headers Or in my previous reply regarding inspect code)

Here, is the Sample Output after Running it:

Note: Handle the new tabs being created when you click the visibility buttons (I have not looked into it, as it is out of scope for this solution)

I hope the selector issue will be resolved with this. If so, do mark it as solution. If not, let me know for further queries.

Cheers.

1 Like

I have implemented your solution in my flow and it has worked perfectly for me. Now I can extract the data of various medications. I really appreciate the time you took to help me.
Thank you so much

Thank you very much for your answer if it was solved using strict selectors.

1 Like

That’s Great. :star_struck:

Do mark the solution, Thank you.

Happy Automation

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.