Web automation ui

hello, i am working on web automation where i have to perform data scrapping,here i have to append data from excel sheet to the web browser and again extract data from web browser to excel sheet . my doubt regarding this is here in web browser there are two tabs like category and states, cities in a country here i have to keep category constant and city and states should be changing one after the other should i keep for loop for the cities and country.