Well, you would need to put this set of actions inside a loop, obviously, so that it runs for all items in the web page. You could probably use Extract data from web page to extract all items at once, instead of using JavaScript. Then loop through all items and write them into Excel.
You cannot really write both values in a single action, because those values are supposed to be written into columns that are not next to each other.
What you could do, however, is if you retrieve data via Extract data from web page and get a data table with two columns, you could in fact write the entire column at once. You would need to use Retrieve data table column into list to get a list for a single column and then write that to column 1 in Excel. Then repeat the same for the other column.
This would effectively mean you could do it all in 5 actions:
- Extract data from web page
- Retrieve data table column into list (for the first column)
- Write data to Excel worksheet (for the first column)
- Retrieve data table column into list (for the second column)
- Write data to Excel worksheet (for the second column)
If the columns in Excel were next to each other (i.e. if you were writing into columns 1 and 2), you could in fact write the entire table at once, effectively doing it all in two actions:
- Extract data from web page
- Write to Excel worksheet
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.