Why does this work:

require 'rubygems'
require 'rubyful_soup'

sourceFile = 'lists.php'
desFile = 'parsedtext.txt'


open(sourceFile).each { |x|
  soup = BeautifulSoup.new(x)
  puts soup.a
  }

but adding .string a la:

require 'rubygems'
require 'rubyful_soup'

sourceFile = 'lists.php'
desFile = 'parsedtext.txt'


open(sourceFile).each { |x|
  soup = BeautifulSoup.new(x)
  puts soup.a.string
  }

results in:
undefined method `string' for nil:NilClass (NoMethodError) ??

Thanks in advance.

-- 
Posted via http://www.ruby-forum.com/.