Permalink
Browse files

simplify some xpath expressions in specs

  • Loading branch information...
1 parent df42508 commit 1feed78d172ddb7240707d21843092b8414cb638 @mislav committed Oct 24, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 scraper.rb
View
@@ -125,7 +125,7 @@ def self.convert_document(doc)
class Article < Scraper
element 'h1' => :title
- element 'a[@href]/@href' => :link
+ element 'a/@href' => :link
end
class TimestampedArticle < Article
@@ -217,7 +217,7 @@ def search(selector)
describe SpecialArticle do
before(:all) do
- doc = Nokogiri::HTML(HTML).at('//div[position()=2]')
+ doc = Nokogiri::HTML(HTML).at('//div[2]')
@article = described_class.parse(doc)
@parent_article = described_class.superclass.parse(doc)
end

0 comments on commit 1feed78

Please sign in to comment.