Sunday, February 16, 2014

How to copy values/items from dropdown in web page

visit this page http://techbrij.com/copy-extract-html-drop-down-list-options-text

1. Open site.
2. Now you need to get HTML source of dropdown list:
For Firefox with Firebug: 
Right Click on HTML Dropdownlist, Select Inspect Element and In firebug, Right click and clickcopy InnerHTML option.
For IE8+:
Press F12, click arrow sign in 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 html source is selected. Right click and click Copy as HTML option.
3. Paste HTML source in Notepad++
4. Remove Select tag from top and bottom if exists
5. Put cursor at top of code and Press Ctrl + F
6. Go to Replace Tab and enter 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 new line then no need to use \n in Replace With option.


To get rid of leading space(s) and all empty lines (even if the empty line contains spaces or tabs)
  1. Go to Search -> Replace
  2. Select "Regular expression" under Search mode.
  3. Use ^\s* for "Find what" and leave "Replace with" blank.
  4. Click Replace all
Regex explanation:
  • ^ means beginning of the line
  • \s* means any number (even 0) of whitespace characters. Whitespace characters include tab, space, newline, and carriage return.

How to extract a URL from a hyperlink on Excel

visit this site: http://howtouseexcel.net/how-to-extract-a-url-from-a-hyperlink-on-excel



  1. Open up a new workbook.
  2. Get into VBA (Press Alt+F11)
  3. Insert a new module (Insert > Module)
  4. Copy and Paste the Excel user defined function below
  5. Get out of VBA (Press Alt+Q)
  6. Use this syntax for this custom Excel function: =GetURL(cell,[default_value])
Function GetURL(cell As range, _
Optional default_value As Variant)
'Lists the Hyperlink Address for a Given Cell
'If cell does not contain a hyperlink, return default_value
If (cell.range("A1").Hyperlinks.Count <> 1) Then
GetURL = default_value
Else
GetURL = cell.range("A1").Hyperlinks(1).Address & "#" & cell.range("A1").Hyperlinks(1).SubAddress
End If
End Function