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

  1. select and copy <select> or it's parent element in the chrome devtool elements tab
  2. paste in the vscode
  3. multi select (shift + command + L or repeat command + D or option + command + up/down arrow) the starting point of texts you want to extract
  4. select texts:
    • single words: command + D
    • multi words: expand selection (shift + control + right arrow)
  5. copy and paste selected texts

done.