It's always ill-advised to poll *anything* with no pause of any kind between iterations.
Also, you don't provide any details of the structure you're targeting. You need to be sure that your queries will actually find the elements you intend. It's possible that you're finding hidden elements, which will always return an empty string for the text content. You're searching for all elements on the page to which class "chat" is applied, looping as long as at least one element is found. Within the loop, you're searching for the first element on the page to which class "_chat" is applied.
Examine the structure of the elements on the page. It's possible that you have more than one "_chat" element, or that you're dealing with a page with frames in it, or some other scenario that your simple loop doesn't handle.