Screen Scraping gives correct results but on running the workflow, it throws "SelectorNotFound" Exception



Hi There,

This is the automation I’m trying to work on:

1.Send hotkey to open “Outlook”
2. Get outlook message containing a particular string.
3. For each such email found, save the attachment in a path mentioned by the user.
4. Loop though each file, fetch some value(lets say ‘X’)
5. Pass ‘X’ as an input to a standalone desktop application to retrieve data further (here, i have a basic application – Screenshot attached)
6. Whatever data is fetched, scrape it & generate a table as output.
7. Write this table data to an excel – or basically collate data from different pdf scraped outputs(from desktop app) in a single excel
8. Mail this collated excel file to certain recipients.

Well, I’ve implemented all steps individually but i have issues in step-6 & step-7.
Also, all these steps except step are in for each loop.

I’ve tried to use “attach window” activity individually as well as “screen scraping”. It gives me the correct output when i try to scrape and also shows me a preview of data scraped which seems fine (except for column orientation – explain later). On running this workflow, I get “Selector Not found” exception. I tried to fix it, tried using UI Explorer, partial selectors, tried setting focus to this window & then scrape but couldn’t get anywhere.
Also, a small issue is when i scrape & preview the table generated it gives a funny output like Id || First || Name Last || Name. whereas, it should be Id || First Name || Last Name. Need to know solution to this as well.

Considering that there could be multiple files downloaded in a folder, for the first PDF file that i scrape data from – i want to write range in excel including headers. For the files that follow, i just need to append. Couldn’t figure out a way to do so in a clean manner

This is my workflow(attaching screenshot as i’m not allowed to upload workflows or multiple screenshots) to make things easy to understand. Please advise what to do as I’ve spent a day to sort this out n couldn’t get anywhere :frowning:
Apologies if there’s anything wrong with my explanation; its the first question I’ve posted here & didn’t know the right way.



Hi Sandhya,

Follow the bellow steps-

  • Store entire output of the Scraped text into an Array of type String

  • Loop through Array using for each activity, Within for each use Generate Data Table Activity and pass the item as a input.

  • Use Excel Scope Activity and provide the path where your file resides(If file does not exist no problem it will create one for you), Within this Activity Use Append Range Activity where you need to pass the output variable of Generated DataTable.







Hi - You can use Get Visible Text activity to scrape. I have attached one sample example just try this out.demo.xaml (9.7 KB)

Thank you,