Archive

Archive for January, 2017

Use JQuery to get data from specific html table column


One of the gigs I am currently working on is to load test a web application. I needed some ids to feed my load test scripts but I didn’t have access to the database. I can view the information on a grid on one of the HTML pages. I solved the problem by using JQuery to query the HTML table and extract the ids I need. The id column is the second column on the grid and hence I am using eq(1) in the script below.

Click F12 to open the dev tools and I excuted the following scripts to get the ids  I needed.

$(‘table > tbody > tr’).each(function(i) {

console.log( $(this).find(‘td:eq(1)’).text())

});

 

About Lajak Technologies

A consulting firm in Ottawa, Ontario that provides services related to Microsoft technologies, Team Foundation Server, DevOps practices, security and more. Contact us today to help you solving your complex software problems. Visit us at http://www.lajak.com.

Categories: javaScript, Uncategorized Tags: ,