2025-05-21
extract text from html dropdown
how i extracted <option>
text from html <select>
dropdown menu recently in the vscode using keyboard shortcuts rather than javascript from the console tab
easiest way is to ask chatgpt, but second easiest way is to just edit the copied html within the vscode
- select and copy
<select>
or it's parent element in the chrome devtool elements tab - paste in the vscode
- multi select (
shift + command + L
or repeatcommand + D
oroption + command + up/down arrow
) the starting point of texts you want to extract - select texts:
- single words:
command + D
- multi words: expand selection (
shift + control + right arrow
)
- single words:
- copy and paste selected texts
done.