How to avoid clicking duplicate records?

Hi,
i am having trouble to get all pdf files from https://www.srpe.gov.hk/opip/default.htm

My current workflow can get below data table into excel, pass value into selector and click the UI-element, i have tried to add column values, row values in the selector. But unfortunately when development name duplicate, robot will always choose the first item.


(E.g LOHA’House duplicate name of development will always click into first item, which mean wrong pdf file.)

i tried to have another browser and pass the url value after data scaping, but it ends up redirect to the front page.

Is there any recommendation to solve this problem?

To visit past 1 day(s) data table please follow below instructions.

  1. Browse https://www.srpe.gov.hk/
  2. Click English
  3. Click Newly Uploaded Sales Brochures / Register of Transactions / Price Lists / Sales Arrangements
  4. Search
  5. click into a name of development
  6. click Register of Transactions to download pdf

Hi @Aaron_Ko

so do u want to avoid the click the first occurence of duplicated records ?

Hi Nambiar,
thanks for the reply.
i would like the robot to click the second, third and fourth item in the for each loop.

lets say i have 4 duplicated name in excel( after scraping the data from Development(s) with register of transactions uploaded in the past 1 day(s) to excel)
i read the excel file and inside of the for each, i apply some click functions. First loop it works perfectly, but when it comes to second, third or fourth loop, it cannot click correct row item.

It is because the ur click is working on selector concepts, so it will identify based on row and column name which u had given in selector, so kindly look whether there is any attribute in the records which is unique and use it in your selector.

ummm the datatable from the website doesn’t really have a unique value.

Hi @Aaron_Ko !
Would you mind sharing your workflow so we look into it together ?

Hi,
thanks for the reply.

Sorry for the late reply too below is my example workflow.
ExampleWorkflow.zip (48.5 KB)

Hi @Aaron_Ko , While creating a selector for clickable element, also add Parent row to Selectors. In parent row, you’ll find innertext attribute. Make the value of innertext attribute dynamic as per Data Table Row.

Let me know if it works.


For your reference. :slight_smile:

Hi Shraddha_Gore,
Thank you for your reply.

If i add innertext attribute into click selector in your case it will basic on development_name,Phase_No,Phase_name,Address and Sub_name to click each row ?

i will give it a try later on and will let you know if it works or not.

In above example, I assumed you want to click on “Name of Development” cell of each different row. I’ve been using innertext method to identify each row for a while. Hope it works for you too !

Hi,
sorry for the late reply haven’t had a chance to test it out, i am having error return, it says Could not find the UI element corresponding to this selector, do i have to pass Chinese and English variables into the selector?

thank you.

Yes, you have to store every column data in a variable & pass all column variables in selector.

I have tried to change the variable around to check the click behavior but unfortunately i am still getting 0% matches.
here is my workflow.

Main.xaml (23.4 KB)

i have been able to complete by passing URL(which is href ) to be able to click correct column. thanks for the help.
Main.xaml (73.6 KB)