Results 1 to 3 of 3
Thread: XML Feed
- 10-03-2012, 07:27 AM #1
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
XML Feed
I'm having a challenge with XML feed from a website.
Hopefully someone can provide advice
I need to gather data each day from a website.
I am specifically interested in the 'rating' column on the far right of each page.
This is an example of the web page
[Moderator edit: link removed]
And this is the xml example of the same page
[Moderator edit: link removed]
I need to gather multiple pages each day (into csv or excel), with the '2011/10/5/BR7' changing - there are different codes BR7 and BR8 etc, for each day -
I beginning to learn Java, but I don't know the most efficient way to proceed.
Is a long java code best, which automatically scrapes and saves the data into a excel file?
Or another method?
This is an xlm example the website offers, but i cannot get it to work. It is for excel 2003 , yet i have 2010 - is that the problem?
Thanks in advance.XML Code:Sub LoadRaceField() Dim xmldoc As MSXML2.DOMDocument Set xmldoc = New MSXML2.DOMDocument xmldoc.async = False xmldoc.Load ("http://t...28/VR6.xml") // Moderator edit: link removed If (xmldoc.parseError.errorCode <> 0) Then MsgBox ("An error has occurred: " & xmldoc.parseError.reason) Else Set runnerList = xmldoc.selectNodes("//Runner") Sheet1.Cells.Clear For i = 0 To (runnerList.Length - 1) Set runner = runnerList.Item(i) Set runnerNumber = runner.Attributes.getNamedItem("RunnerNo") Set runnerName = runner.Attributes.getNamedItem("RunnerName") Set runnerWeight = runner.Attributes.getNamedItem("Weight") Set riderName = runner.Attributes.getNamedItem("Rider") If Not runnerNumber Is Nothing Then Sheet1.Cells(i + 1, 1) = runnerNumber.Text End If If Not runnerName Is Nothing Then Sheet1.Cells(i + 1, 2) = runnerName.Text End If If Not runnerWeight Is Nothing Then Sheet1.Cells(i + 1, 3) = runnerWeight.Text End If If Not riderName Is Nothing Then Sheet1.Cells(i + 1, 4) = riderName.Text End If Next End If End SubLast edited by DarrylBurke; 10-03-2012 at 08:24 AM. Reason: Removed spammy links
- 10-03-2012, 09:30 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
Re: XML Feed
This is not a beginners level task.
If you don't know Java you are going to make a right hash of this.
That's my first comment.
After that, then break the task down into steps and write code for each of those steps.
One decision you'll need to make is whether you need to whole document in order to process parts of it.
If you can get away with only processing it via streaming then I would aim for that.
How you process it is entirely down to what needs doing (and is not something we could possibly cover here).
You could, for example, do some form of transformation, passing the XML stream in and an xslt which would output it straight into a csv file (which would be my choice).Please do not ask for code as refusal often offends.
- 10-04-2012, 04:50 AM #3
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Reading RSS feed
By jprog in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-10-2011, 11:07 AM -
RSS Feed help..
By _ShivamKapoOr_ in forum New To JavaReplies: 2Last Post: 09-16-2010, 02:32 PM -
what is web service and rss feed
By javastuden in forum Advanced JavaReplies: 0Last Post: 03-01-2010, 04:43 AM -
Web service and RSS feed (maybe?)
By richiebabes in forum Advanced JavaReplies: 6Last Post: 06-28-2009, 09:42 PM -
line feed in CSV
By javaplus in forum New To JavaReplies: 2Last Post: 01-24-2008, 03:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks