How to identify the right most column in a web table

I need to scrape monthly data from a table that grows over the course of the year as data is available (e.g. when Jan data is available there is only 1 column, in once the May data is available there will be 5 columns).

Some teams upload their data late, also some teams start during the year so their first column may be Apr, not Jan. As such, predicting the right most column number when I start scraping data is not predictable.

Because of both of these issues I have captured the latest data month in my data file for comparison in future runs - if there is no newer data, I want to skip the scraping and move to the next team for a more efficient run.

However I’m not sure how to most efficiently determine the right-most column to then find the team’s most recently reported month to do the comparison against the latest month I’ve already recorded. Any suggestions?


I think we can use ElementExists activity which has selector contains target text:

<webctrl aaname='May' tag='TH' tableRow='1' />

If ElementExists returns true, we can skip this table because it already exists.


Nice idea. How do I replace ‘May’ with a string variable so I can change what the ElementExists looks for each month? I’ve tried a few things but when I click Validate I get the red X (fail).

I worked the variable part out, but I had to not use the default element editor and edit in the Properties > Target > Selector field and treat it like a text field.

"<webctrl aaname='"+strLatestMonth+"' tag='TH' tableRow='1' />"
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.