HTML Question
Saturday, December 23, 2006 by jlaj1989 | Discussion: DesktopX
Reply #2 Sunday, December 24, 2006 10:42 AM
Reply #3 Sunday, December 24, 2006 1:38 PM
Look at the System.SendRequest(remoteUrl, postParams, bAsync) sample from
DX Docs (Scroll to bottom)
There's a sample of how to make the request, and the callback that will have your result.
If you can't use standard XML or RSS style parsing on the received data, there are several options for extracting it, as sViz pointed out.
One frequently useful approach is to use the vbscript Split function. W3Schools
If there are identifying strings around the relevant data, you can split the HTML into an array at those strings. Like if the page displayed the names:
Name: Hooter
Name: Killjoy
Name: Jester
You could Split(WebPageSourceHTML, "Name: ") to get an array of strings. You'll find the names at the beginning of the strings in Array(1-3). You would split these strings themselves by a space to fully extract the name data. Sometimes you'll split more than once. Like split for tables, get the table you want, then split it for some other identifier to isolate the desired info. When using splits, remember that the string in NewArray(0) is the text before the split, and the strings in NewArray(1-n) are strings that come after your chosen delimiter. I'm just saying this is a time where I often forget about the zero momentarily and have to rethink it. Once you get a good parser together, though, you can do a lot with it.
As long as the HTML from your server info presents itself the same way each time, you should be able to use string manipulation vbscript on the 'pagecontent' results from a System.SendRequest to extract any information you want.
Reply #4 Sunday, December 24, 2006 6:09 PM
| Will a rss reader work for any site? |
If you manipulate the script it can work for html but you have to have some kind of identifier for the info you want or it won't work. I think Rabidrobot explains it better. I didn't know about system.sendrequest. I tried it like so:
strPage= System.SendRequest("http://www.comcast.net", Get, False)
and kept getting a syntax error. If you can get it to work then using the Split function like Rabidrobot explained is probably the way to go.
Reply #5 Sunday, December 24, 2006 6:18 PM
If forgot the quotations around "Get".
Will get back to you.Reply #6 Sunday, December 24, 2006 6:37 PM
Reply #7 Sunday, December 24, 2006 6:42 PM
There is a tutorial on how to make an RSS reader by CerebroJD WWW Link
Took me a while to figure it out but once I got the hang of it I was able to make my very own RSS feeder.(To be released soon)
Reply #9 Sunday, December 24, 2006 11:53 PM
Looks great to me, you can use multiple text objects or create a long string with vbTab and vbNewline to emulate a table--once you snip out the key info.
If you want to display all the information, consider styling the table you've already extracted with CSS. It's already well laid out, and the html has class assignments in place.
Reply #10 Monday, December 25, 2006 5:21 AM
Well, I worked out a script for just the info you had in the text object. I had trouble removing unwanted spaces and keeping the spaces you do want. If you check out the object below you'll see how I opted to deal with it. Maybe you'll find this script useful for something. Okay here's the object with the script: LINK
Like rabidrobot said perhaps you could create a text object for each table of contents and insert a similar script to the one above modified to extract the correct information.
Reply #11 Monday, December 25, 2006 11:07 AM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Sunday, December 24, 2006 2:27 AM
Yes, I think so. I'm no expert but I was fooling around with the source code from this daily factoid site and even though it wasn't formatted to be read like xml I could still pull the information I wanted from the HTML code.
Load up the webpage that you’re trying to get info from and go to your explorer Commands bar > View > Source. If you can view the source code this might work. Take a look at the code and see if you can find the information you want to ‘pull’. Does it have an identifier like a specific html tag or a unique syntax? If so, you should be able to get an rss reader to pull that information. Let me know if this is a start in the right direction.