# Hpricot xpath help

**URL:** <https://www.ruby-forum.com/t/hpricot-xpath-help/178471>\
**Category:** Rails\
**Created:** [November 5, 2009, 4:16am UTC](https://www.ruby-forum.com/t/hpricot-xpath-help/178471 "2009-11-05T04:16:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eggie5](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Post date:** [November 5, 2009, 4:16am UTC](https://www.ruby-forum.com/t/hpricot-xpath-help/178471/1 "2009-11-05T04:16:21Z")

</div>

I have this XML:

\<?xml version="1.0" encoding="UTF-8"?\>

111  
2009-03-02 - 2009-03-08  
2009-03-08T00:00:00  
  
  
113  
2009-02-16 - 2009-02-22  
2009-02-22T00:00:00  
  
.  
.  
.

I want to parse out the Week element with the weekID of 111.  
I’m using Hpricot and this but I can’t find it. What’s the xpath?  
doc.search(’//Week[weekID=111]’)

---

<div class="post-metadata">

**Author:** ![eggie5](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Post date:** [November 5, 2009, 6:07am UTC](https://www.ruby-forum.com/t/hpricot-xpath-help/178471/2 "2009-11-05T06:07:35Z")

</div>

On Wed, Nov 4, 2009 at 7:15 PM, eggie5 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I want to parse out the Week element with the weekID of 111. I'm using Hpricot and this but I can't find it. What's the xpath? doc.search('//Week[weekID=111]')

What’s the issue?

-Conrad
