You could use an Xpath expression similar to
//div[@class='result-box']|//h3|//em[@class='reservepoints']
This doesn't sum the reserpoints values.
Thank you for your answer. The thing I would like to achieve is to retrieve
the following (non HTML compliant) website. This page represents the soccer selection for a team within the game profcoach. As the website does not give much statistical data I thought why not use YQL and Pipes to make a nice feed/output to be used to give a readable XML/JSON.
The main goal is to retrieve the following information from the source:
CODE
<player>
<teamname>FC Knooiers on Tour</teamname>
<weekscore>7.1</weekscore>
<bench>
<substitute>
<name>Waterman</name>
<weekscore>6.0</weekscore>
</substitute>
<substitude>
<name>Looms</name>
<points>10.0</points>
</substitude>
</bench>
<total-score>566.0</total-score>
</player>
Based upon this data I can give a user their specific information, like total-score, week-score and the number of points left on the bench. In order to achieve this I have created the following YQL:
CODE
select * from html where url="http://www.profcoach.nl/DataProvider/LineUpParticipant.ashx?roundid=20101112&lineUpParticipantId=18803&do=1" and xpath="//div[@class='result-box']/h6|//div[@class='result-box']/ul/li[1]/strong|//em[@class='reservepoints']|//div[@class='reserves-box']/h3"
The YQL is used in the following Pipe document:
http://pipes.yahoo.com/pcstats/userweekI hoped that is was possible:
- to group the information from item.class = 'reservepoints' into <bench> or do a sum for the values
- to replace the h3 with the <teamname>
- to replace the h6 with <weekscore>
- to replace the strong with <total-score>
Can I do this with YQL and Pipes or isn't this the best way to use this solution? I was inspired after viewing
this pipe which is described in
this Dutch article.