You can use Execute Script
in this case:
var d = document.getElementById("WhatSoftware");
var selectedText = d.options[d.selectedIndex].text; return selectedText;
Test macro:
{
"Name": "dropdown_scraping",
"CreationDate": "2021-5-28",
"Commands": [
{
"Command": "open",
"Target": "https://ui.vision/contact",
"Value": "",
"Description": ""
},
{
"Command": "select",
"Target": "id=WhatSoftware",
"Value": "label=UI Vision Pro/Enterprise [Priority Support]",
"Description": "Select the value. We will scrape it in the next line"
},
{
"Command": "executeScript",
"Target": "var d = document.getElementById(\"WhatSoftware\");\nvar selectedText = d.options[d.selectedIndex].text; return selectedText;",
"Value": "t",
"Description": ""
},
{
"Command": "echo",
"Target": "Dropwdown text=${t} ",
"Value": "green",
"Description": ""
}
]
}