01-07-2010 02:18 PM
I've got a program that I'm working on, but it isnt working quite right.
I'm trying to open up this weather page:
http://weather.noaa.gov/weather/current/KJXN.html
then get certain pieces of information, and save them to a spreadsheet file programmatically.
I can handle all of that, except I'm having a little trouble parsing out the information I want.
I'm using the three attached VI's (1 top level, 2 subVI's. The "Read Temp WS....." is the top level) that I found somewhere on the forums.... can't quite remember where. I modified them a bit too.
If you run the top level VI as-is, you will see a text indicator on the front panel that shows the source code for the website I posted above.
I know that all the information I need is in this format:
<TD><FONT FACE="Arial,Helvetica"> * </FONT></TD>
Where the * represents the data that I want.
So basically, I tried use a Match Expression function in a loop to find each instance of the above expression.
It isnt working quite as I had hoped.
Can anyone see what I am doing wrong?
Thank you.
01-07-2010 02:42 PM
01-07-2010 03:00 PM - edited 01-07-2010 03:01 PM
I changed the Insert Into Array to Build Array... I guess I was just in a Rube Goldberg mood.
The string is still being parsed incorrectly though.
01-07-2010 03:07 PM
I just realized something. It isnt the top-level VI causing the issue.
The subVI is not reading the source code in correctly.
If you open the URL in a web browser, then select 'View Source' and compare that to what the front panel shows, you will notice some subtle differences.
I will take a look at that and see what is going on.
01-08-2010 11:09 AM
I figured out what the problem was.
Just in case anyone ever runs into a similar problem, I will post the VI.
01-12-2010 12:22 PM
Well, I thought I solved this issue, but I guess not entirely.
My approach was the following:
1) read the source code of the web page.
2) search through the source code (converted to string) for a certain string pattern
3) build an array of all the matches
4) index out the fields I need
Here's the issue:
If you run the program one day, it will run fine. But if you run it a different day, it may or may not work.
The reason is because the source code is shifted around, and things are sometimes at different indexes.
Does anyone recommend a better approach than what I described above?
01-12-2010 03:32 PM
How about if you look for something more spacific? See attached.
I tried it a few times and it give me the answer that I am expecting.