Dynamic click


I’m working on an application that scrapes the date out of an online agenda to later migrate it to an other one. The agenda looks like the screenshot included. I can scrape the first page, but when you click on the appointment it show additional information I also need to scrape, how can I decide where to click. As I said I can scrape all the appointments, but although it has an excel look, it’s not structured that way, when scraping the result is a datatable with only one row and 7 columns for every day one. For now I scrape all the appointments, then extract all the names from the appointments, cause I need the names to get additional information from the patient tab. I tried using that name dnamicly in the selector for the click, but that didn’t work (aaname=‘“+name+”’ ), I also actually need to click on the red or blue colored onces, any tips on how to achieve this?

Ah I understand the issue. You might not have access until you hover or click over the element which makes it (just maybe 4% :stuck_out_tongue: ) trickier than it is supposed to be.

Although without knowing the application you are working on this would end up being a tall claim so can you provide more details with this?

App name, exact usecase as to why can the other details be scraped during the second iteration/run, are there API’s we can explore etc…

No api’s for the moment, it’s an online agenda where patients can make appointments to see the doctor, for testing purpose I now use the selector I got when I clicked on an element and I can see that depending on where I click the aaname changes, sometimes it’s just the name, sometimes it includes the time and sometimes it isn’t there at all but I get an idx instead, it’s not in the second iteration the details are being scraped succesfully, it’s in the same iteration but in a different place.
Let me explain the flow.
I first use datascrapping to get all the appointments, then I loop the datatable for each row and extract the fullname from the values, then it’s suposed to click for each name on the appointment making a popup appear (like in attachement) where I have to scrape some more information, like the reason they’re visiting and then I navigate to the patient tab, put the name in a searchbar to get the patientinformation, scrape that and write everything in a csv file, for now, later on I should create jsonobjects of it for importation, but their api isn’t ready yet
The first part and the last part I got handled, it’s just getting the popu that’s giving me a hard time

This is the error I’m getting:
19.10.0-beta.90+Branch.release-v2019.10.0.Sha.ed11515279eee4447b9cc03a899373aa74312c09

Source: Click 'DIV'

Message: Cannot find the UI element corresponding to this selector: <webctrl aaname='&quot; + name + &quot;' parentid='calendar' tag='DIV' />

Exception Type: UiPath.Core.SelectorNotFoundException

RemoteException wrapping UiPath.Core.SelectorNotFoundException: Cannot find the UI element corresponding to this selector: <webctrl aaname='&quot; + name + &quot;' parentid='calendar' tag='DIV' />  ---> RemoteException wrapping System.Runtime.InteropServices.COMException: Cannot find the UI element corresponding to this selector: <webctrl aaname='&quot; + name + &quot;' parentid='calendar' tag='DIV' /> 
   at UiPath.UiNodeClass.FindFirst(UiFindScope scope, String nodeID)
   at UiPath.Core.UiElement.FindFirst(FindScope scope, Selector selector, IPlaceholderResolver placeholderResolver)
	--- End of inner exception stack trace ---
   at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
   at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
   at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
   at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
   at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)