How to make a semi automatic macro to run in more than one site?

Hi, maybe some could help me with some suggestion in how to do this. I have more than one site that shows information in a structure like categories/subcategories/target. Between one site and the other there is similar structure visually talking. but obviously, classes, IDs, etc change. For example a site like this shows addresses of locations but to get the addresses I need to drilldown by levels “State/City/location”. The manual process would be click in any state (level 1). then click in any city (level 2), then click in any location (level 3) and get the address.

In order to scrape more than one site that looks similar, (without knowing previosly the classes, IDs, or Xpaths of each site) I was wondering if there is a way to get the class or id of any level (states/city/location) when the user moves the cursor over a desired element?

I mean, run the macro to open main URL, pause the macro until the user does a “mouse over” over one state (grab the class of the table or div) and then the macro would know how to do a loop over all states. Repeat the process for cities, locations. Not sure if sounds crazy or how would you suggest? The main goal is to have a macro that works for more than one site with similar structure.