first-of-type

13 views
Skip to first unread message

Arthur McLean

unread,
Mar 1, 2012, 4:38:05 PM3/1/12
to hpricot
I think I found a bug.

I'm reading in the source code from this site (it's the print page
because the article is all on one page - just hit cancel):
http://www.budgettravel.com/print/8358/
I am trying to remove the first H3. However, when I do this:
doc.search("h3:first-of-type").remove
...it finds and removes the first two H3's.

You can see what's returned by doing:
pp(doc.search("h3:first-of-type"))

I've also tried:
doc.search("h3:first-child").remove
... but that emits warnings.

Any suggestion of a work-around would be appreciated.
Reply all
Reply to author
Forward
0 new messages