# Problems with scRUBYt

**URL:** <https://www.ruby-forum.com/t/problems-with-scrubyt/156620>\
**Category:** Ruby\
**Created:** [December 31, 2008, 12:33am UTC](https://www.ruby-forum.com/t/problems-with-scrubyt/156620 "2008-12-31T00:33:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cswebgrl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Post date:** [December 31, 2008, 12:33am UTC](https://www.ruby-forum.com/t/problems-with-scrubyt/156620/1 "2008-12-31T00:33:49Z")

</div>

Hi.

I am currently scraping a page with scRUBYt and am not getting the  
results as expected.

Instead of the correctly formatted xml document I’m getting the  
following.

 \<1\>book a \<1\>book b \<1\>book c \<2\>chapter aa \<2\>chapter bb \<2\>chapter cc \<3\>verse aaa \<3\>verse bbb \<3\>verse ccc

My code looks like this:

listing “//a[@id\*=‘volume’\>” do  
book “//a[@class=‘1’]”  
chapter “//span[@class=‘2’]”  
verse “//a[@id\*=‘3’]”  
end

Any ideas?

Sorry for the sample data, but hopefully someone has seen this before  
and can help.

---

<div class="post-metadata">

**Author:** ![cswebgrl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Post date:** [December 31, 2008, 1:38am UTC](https://www.ruby-forum.com/t/problems-with-scrubyt/156620/2 "2008-12-31T01:38:32Z")

</div>

On Wed, Dec 31, 2008 at 08:33:26AM +0900, Cs Webgrl wrote:

> \<1\>book b\</1\>  
> \<1\>book c\</1\>  
> \<2\>chapter aa\</2\>  
> \<2\>chapter bb\</2\>  
> \<2\>chapter cc\</2\>  
> \<3\>verse aaa\</3\>  
> \<3\>verse bbb\</3\>  
> \<3\>verse ccc\</3\>

This is a correctly formatted XML document. You just have numbers for  
tag names.

> My code looks like this:
> 
> listing “//a[@id\*=‘volume’\>” do  
> book “//a[@class=‘1’]”  
> chapter “//span[@class=‘2’]”  
> verse “//a[@id\*=‘3’]”  
> end
> 
> Any ideas?

Have you tried something like this:

book “//2[@id=‘whatevs’]”

That should get you access to the tags.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![cswebgrl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Post date:** [December 31, 2008, 2:02am UTC](https://www.ruby-forum.com/t/problems-with-scrubyt/156620/3 "2008-12-31T02:02:44Z")

</div>

Aaron P. wrote:

> Have you tried something like this:
> 
> book “//2[@id=‘whatevs’]”
> 
> That should get you access to the tags.

This gives me a ton of data, but now I have lost the specific pieces of  
information that I’m looking for. Instead it looks like the output of  
all of the sourced code on that page. Was I to change something else in  
the code to get the specific piece of data that I need?
