Last active
June 23, 2017 05:31
-
-
Save kuyseng/8408f3741fbe6084b60e150f7ac81f80 to your computer and use it in GitHub Desktop.
Dexi Robots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mainContent = document.getElementById('mainContent'); | |
var tds = mainContent.getElementsByTagName('td'); | |
var texts = []; | |
for(var i=2, len=tds.length; i< len; i++) { | |
if(/\[P|F\]/.test(tds[i].innerHTML) || i > 4 ) { break } | |
texts.push(tds[i].textContent.trim()); | |
} | |
texts.join(', '); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bizContact = $('tr:contains("Business Contact")'); | |
var infos = bizContact.next(); | |
var spans = infos.find('.search_field_value span'); | |
var texts = []; | |
var str = ''; | |
for(var i=0, str,len=spans.length; i<len; i++) { | |
str = $(spans[i]).text(); | |
if(/Phone|@/.test(str)) { break; } //skip when is phone or email | |
texts.push(str); | |
} | |
texts.join(", "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// extract value through javascript | |
var elems = $('abbr[title="Telephone"]'); | |
var texts = []; | |
elems.each(function(_, dom) { | |
texts.push($(dom).parent().text()); | |
}); | |
texts.join('; '); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var table = document.getElementById('ctl00_ContentPlaceHolder1_Directors'); | |
var tableRows = table.rows; | |
tableRows[0].remove(); // to skip header | |
var texts = []; | |
for(var i=0, len=tableRows.length, row, text; i< len; i++) { | |
row = tableRows[i]; | |
text = row.cells[0].textContent; // Name | |
text += (' - ' + row.cells[2].textContent); // Title | |
text += (' (' + row.cells[1].textContent + ')' ); // Register Number | |
texts.push(text); // in format: "Name - Title (Register Number)" | |
} | |
texts.join("; \n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment