Convert HTML list to JSON


I have a little problem with my HTML template for convert to JSON. I wish convert a list of HTML messages to JSON. Thank you in advance for your response.

HTML Template

<div class="message">
    <div class="message-data">
        <div class="infos">
            <h4 class="pseudo">Name</h4>
            <span class="date">MM/DD/YYYY</span>
            <span class="time">HH:MM</span>
    <div class="message-content">
        <div class="message-text">
            Message here

<!-- Others .message -->

JSON Render

    "list": [
            "pseudo": "Name",
            "date": "MM/DD/YYYY",
            "time": "HH:MM",
            "message": "Message here"
        /* ... */

even if it doesn't look that cool I think this will be much faster:

var pseudo = document.getElementsByClassName("pseudo");
var date = document.getElementsByClassName("date");
var time = document.getElementsByClassName("time");
var message = document.getElementsByClassName("message-text");

var list = [];
for(var i=0, l=pseudo.length;i<l;i++) {
    pseudo: pseudo[i].textContent,
    data: date[i].textContent,
    time: time[i].textContent,
    message: message[i].textContent

.. depending on your file structure this may not be the best solution