From: Ryan Davis Date: 2009-03-16T15:30:25+09:00 Subject: Re: `&' interpreted as argument prefix On Mar 15, 2009, at 21:14 , Arun Kumar wrote: > Hi, > I'm new to rubi and at present i'm trying to write a sample code for > html extraction and store it in the database. The following is the > code > for that : > > doc = Hpricot(open("http://www.google.com/")) > (doc/"a").each do |link| > if (link.attributes['class'] == 'gb1') > href = link.inner_text.strip > con = DBI.connect("DBI:Mysql:Sample:localhost", "arunkumar", > "123456") > stat = con.prepare("Insert into hello values ('', ?, 'GK', 71, > 'female')") > stat.execute("#{href}") > stat.finish > con.commit > puts "Records have been inserted" > else > puts "Sorry! No matches found." > end > end > > When i execute it all works well except a warning saying : > /usr/lib/ruby/gems/1.8/gems/hpricot-0.6.164/lib/hpricot/builder.rb:26: > warning: `&' interpreted as argument prefix that's from hpricot and won't change anytime soon :/ you may want to switch to mechanize instead. Kill two birds with one stone.