Copy/Extract HTML select options in plain textx

Contents

  1. Steps:

You want to copy HTML dropdown list options from a web page. You do right-click on the dropdown list. Oh my God !!! There is no option to do it. This article explains how to extract dropdown list options using Notepad++.

Steps:

1. Open site.
2. Now you need to get the HTML source of the dropdown list:

For Firefox with Firebug:
Right Click on HTML Dropdownlist, Select Inspect Element and In firebug, Right click and click copy InnerHTML option.

For IE8+:
Press F12, click the arrow sign in to developer tools and Select Dropdownlist. Now you will see HTML source is selected in developer tools, right-click and click copy InnerHTML option.

For Chrome:
Right Click on HTML Dropdownlist, Select Inspect Element and In Developer Tools, you will see that the HTML source is selected. Right-click and click Copy as HTML option.

3. Paste the HTML source in Notepad++
4. Remove the Select tag from the top and bottom if it exists
5. Put the cursor at the top of the code and Press Ctrl + F
6. Go to Replace Tab and enter the following info:
Find What:
<option[^>]*>([^<]*)</option>
Replace With:
\1\n
Select Regular Expression as Search Mode and click on Replace All.

If options are already in the new line then no need to use \n in Replace With option.

notepad++ find and replace

You will get all options in plain text. If there are a lot of options, It will save a bunch of time.

Revisions

No comments yet.

Leave a Reply