Data Scraping not working in for each loop

I have to do web scraping from facebook. When I do it for a single user, it works. But when I do it for multiple users in a for-each loop it does not return any data. Following are the steps:

  1. Log in to Facebook
  2. Read csv containing user names
  3. In For-each loop, search candidate. Collect data of all the users displayed using web scraping method. Write it to another excel sheet.
  4. Log out.
    This is the selector for the attach window of data scraping:
    html omit:htmlwindowname=’_e_0Xkq’ title=’* - Facebook Search’ /

Please help

Did you try to use “Attach to live element” on the selector which is not working ? It seems to me that the selector is not generic enough …

I havent tried this. How do I use it in above case?

Identify the selector which is not working , (works only for the first user and not for the subsequent one’s ) , open its selector , and click on “Attach to live element” , and point to the user 2. This ways UIpath will adjust the selector automatically to work in both the cases , User 1 and User 2 … i.e it will make the selector generic enough so that it works for both the cases …


Should I point to the whole window? I an getting error like ‘Could not attach to element’

Not the whole window , the element which you pointed previously … …

have a look at this

1 Like

htmlwindowname keeps changing. Giving * in it also doesnt work. How do I point to current window?

Check if you are able to use any other selector apart from htmlwindowname , use UIexplorer to identify and test the selectors …

Hi shrutika,
I am getting the same error as yours.Is your error get solved?

The issue was with selectors. I was not able to identify dynamic selectors. Using Attach to live elements worked for me.