# Hpricot wont parse \<a\> elements via XPath

**URL:** <https://www.ruby-forum.com/t/hpricot-wont-parse-a-elements-via-xpath/168789>\
**Category:** Ruby\
**Created:** [May 25, 2009, 11:39pm UTC](https://www.ruby-forum.com/t/hpricot-wont-parse-a-elements-via-xpath/168789 "2009-05-25T23:39:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archer007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f1d935/32.png) [@archer007](https://www.ruby-forum.com/u/archer007)\
**Post date:** [May 25, 2009, 11:39pm UTC](https://www.ruby-forum.com/t/hpricot-wont-parse-a-elements-via-xpath/168789/1 "2009-05-25T23:39:18Z")

</div>

In this code ([http://pastebin.com/m36de2949](http://pastebin.com/m36de2949)) unread\_links will not read  
the elements specified in line 12. I double-checked the XPath with  
the XPather Firefox extension, and it is correct.

 

Is this some obscure difficulty with Hpricot? I seem to be doing  
everything correctly.

---

<div class="post-metadata">

**Author:** ![archer007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f1d935/32.png) [@archer007](https://www.ruby-forum.com/u/archer007)\
**Post date:** [May 26, 2009, 12:23am UTC](https://www.ruby-forum.com/t/hpricot-wont-parse-a-elements-via-xpath/168789/2 "2009-05-26T00:23:59Z")

</div>

On May 25, 2009, at 5:39 PM, No Uu wrote:

> In this code ([http://pastebin.com/m36de2949](http://pastebin.com/m36de2949)) unread\_links will not  
> read  
> the elements specified in line 12. I double-checked the XPath with  
> the XPather Firefox extension, and it is correct.
> 
>  
> ## Is this some obscure difficulty with Hpricot? I seem to be doing everything correctly.

 

It looks like those tags are first children of the so there is no preceding-sibling for them.

 

Perhaps you need to post what you expect to read in addition to the  
xpath that you’re trying to use to find it.

 

-Rob

 

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
