This time I think I found a solid workaround for the problem I have been facing with Data Scraping.
I feel pulling all the HTML and then parsing thru the data to get the required information is the most consistent way of doing so with this web application (if anyone has an alternative please let me know).
Well, let me walk you through what I am trying to do.
I am pulling HTML that is located inside a DIV tag, then parsing thru those lower tags to get my required information (Name, Address etc…).
However, the data will span multiple pages in some instances. I have attached a snapshot to this which shows the HTML code for this particular button.
Whenever I reach the last page the ‘button’ tag will have a ‘disabled’ attribute equal to “disabled” when it has reached last page. This can be indicator that I no longer need to move forward and can finish automation.
However, instead of parsing thru each tag which will suck up memory I am wondering if there is a quicker way to parse thru HTML to get both the required info I need (NAme, Address etc…) AND the button tag status (disabled or not). Has anyone done something similar to this and can provide some helpful hints?
You can also use Get Attribute Activity to get an “aastate” attribute if it is disabled then it’s value will be unavailable, focusable and if it is enabled then it’s value will be focusable.
according to this activity output you can proceed further.
Yeah have to deal with it… what here can help you is use “UI Explorer” and observe the properties of Html data elements
I know how to use UiExplorer to identify elements.
However, what I am unsure how to do is look at certain elements when the number of said elements (in this case patient line items) can vary…the last page may have 6 line items where the preceding pages have 10.
You could probably use the activity Find Children targeted to the element that has ‘results’ class.
It will return an IEnumberable that holds all its child elements. It would be a dynamic approach since it does not care if it has 1 or 10 elements or search results in this case.
Thank you so much for the help. The Find Children definitely works, however I am wondering if you can iterate thru this output to get each individual tag that houses the info I need?
In other words, when I use Find Children it will give me back all info for first line item (all of which I assume are held in separate tags) is there a way where I can iterate thru each of these and then allocate to variables?
There are probably nicer ways of doing this but I came up with a couple of solutions.
If the ‘separate tags’ you refer to are always identical you can just use them as selectors at a Get Text -activity(assuming you want the innertext/value rather than the TAG name) that is inside a For Each -Child element loop.
If the ‘separate tags’ vary or are not always there you can do another Find Children and then do another For Each loop with these child elements and use Get Text to get the values of those.