MATLAB: Issues reading updated HTML page content using MATLAB

dynamic reading of html page content

I am writing the web page HTML into a text file as line by line filename = 'webpagecontents.txt'; urlwrite(URL,filename); C = textread(filename, '%s','delimiter', '\n');
The text I am searching for is then extracted from the 16th line as msgbox(C(16))
Now the user interacts with the web page and the status message changes on the actual web page However, I am unable to retrieve it in the text file. It still shows the same old content.
How do I get the updated status message? I right clicked the web page and viewed its source file after the status updation. No change is observed there also. Any help is appreciated

Best Answer

Two things:
1. When matlab requests the page from the server (using urlwrite or any other method), it's never going to see the changes generated by the user, the same way you wouldn't expect another user to see the changes you make locally. The only way for you to pick up the changes would be either to talk to the web browser the user is using (assuming it is possible) or to actually render the page in matlab and have the user interact with the page from matlab (assuming it is possible with the limited gui tools of matlab).
2. If, in the web browser, you can't see the changes to the source of the page when you interact with it this means that the page is manipulated using javascript. This only change the content of the page in memory and on screen. Again, just reading the source won't help you and you either need to ask the web browser or implement your own browser.
Basically, your assumption is wrong. The page source itself is not updated, it's only the in-memory representation that is changed.