<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Scraping with style: scrAPI toolkit for Ruby</title>
	<atom:link href="http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/</link>
	<description></description>
	<lastBuildDate>Mon, 15 Mar 2010 17:05:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: soc88</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-142876</link>
		<dc:creator>soc88</dc:creator>
		<pubDate>Mon, 18 Jan 2010 10:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-142876</guid>
		<description>Hey guys, I&#039;m new to screen scraping and I need to do it for an iPhone app I&#039;m developing. I&#039;m not too sure where to start. Any help or comments will be great!! Thanks alot guys!</description>
		<content:encoded><![CDATA[<p>Hey guys, I&#8217;m new to screen scraping and I need to do it for an iPhone app I&#8217;m developing. I&#8217;m not too sure where to start. Any help or comments will be great!! Thanks alot guys!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-142665</link>
		<dc:creator>Jack</dc:creator>
		<pubDate>Sun, 13 Dec 2009 04:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-142665</guid>
		<description>Scrapi doesn&#039;t work with 1.9. Any clues?</description>
		<content:encoded><![CDATA[<p>Scrapi doesn&#8217;t work with 1.9. Any clues?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Personalberatung</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-141097</link>
		<dc:creator>Personalberatung</dc:creator>
		<pubDate>Wed, 13 Aug 2008 09:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-141097</guid>
		<description>I also think that it would be great to get a guide for beginners, 
thanks a lot.</description>
		<content:encoded><![CDATA[<p>I also think that it would be great to get a guide for beginners,<br />
thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Webdesign</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-140943</link>
		<dc:creator>Webdesign</dc:creator>
		<pubDate>Sat, 26 Jul 2008 12:28:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-140943</guid>
		<description>Thanks a lot, this is very useful. Would be glad if there is a dummy guide for beginners. Anyway thank you very very much!!!</description>
		<content:encoded><![CDATA[<p>Thanks a lot, this is very useful. Would be glad if there is a dummy guide for beginners. Anyway thank you very very much!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emerson</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-140726</link>
		<dc:creator>Emerson</dc:creator>
		<pubDate>Wed, 25 Jun 2008 19:09:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-140726</guid>
		<description>Im new to Ruby and ive been struggling a bit recently with gems and windows.  

It seems that many projects dont give much thought to how a gem might work on environments other than linux/osx. 

So for a lot of gems, i end up downloading dll&#039;s separately and putting them into my C:\Ruby\bin directory to make things work.

I was using Scrapi and noticed that it tries to package Tidy with it rather than relying on &quot;require &#039;tidy&#039;&quot; so my usual dll trick didnt work, and when i tried to run some code i would see an error about &quot;libtidy.so&quot; not being a valid windows object file.  You dont say...

So i did some digging, and i can see that in the &quot;find_tidy()&quot; method in reader.rb, Scrapi tries to set the Tidy path. But its coded wrongly.  

Since the Scrapi gem ships with both a linux &quot;.so&quot; and a windows &quot;.dll&quot; the windows dll will never be found before the linux &quot;.so&quot; according to the strategy in &quot;find_tidy()&quot;.

def find_tidy()
      return if Tidy.path
      begin
	Tidy.path = File.join(File.dirname(__FILE__), &quot;../tidy&quot;, &quot;libtidy.so&quot;)
      rescue LoadError
        begin
          Tidy.path = File.join(File.dirname(__FILE__), &quot;../tidy&quot;, &quot;libtidy.dll&quot;)
        rescue LoadError
          Tidy.path = File.join(File.dirname(__FILE__), &quot;../tidy&quot;, &quot;libtidy.dylib&quot;)
        end
      end
    end

I suggest you use a platform detection mechanism like so:

&quot;RUBY_PLATFORM =~ /mswin32/&quot;

And then the code will play more nicely.  Otherwise, just stick to &quot;require &#039;tidy&#039;&quot;, atleast then Scrapi will only have the same problem that all the other gems do :)</description>
		<content:encoded><![CDATA[<p>Im new to Ruby and ive been struggling a bit recently with gems and windows.  </p>
<p>It seems that many projects dont give much thought to how a gem might work on environments other than linux/osx. </p>
<p>So for a lot of gems, i end up downloading dll&#8217;s separately and putting them into my C:\Ruby\bin directory to make things work.</p>
<p>I was using Scrapi and noticed that it tries to package Tidy with it rather than relying on &#8220;require &#8216;tidy&#8217;&#8221; so my usual dll trick didnt work, and when i tried to run some code i would see an error about &#8220;libtidy.so&#8221; not being a valid windows object file.  You dont say&#8230;</p>
<p>So i did some digging, and i can see that in the &#8220;find_tidy()&#8221; method in reader.rb, Scrapi tries to set the Tidy path. But its coded wrongly.  </p>
<p>Since the Scrapi gem ships with both a linux &#8220;.so&#8221; and a windows &#8220;.dll&#8221; the windows dll will never be found before the linux &#8220;.so&#8221; according to the strategy in &#8220;find_tidy()&#8221;.</p>
<p>def find_tidy()<br />
      return if Tidy.path<br />
      begin<br />
	Tidy.path = File.join(File.dirname(__FILE__), &#8220;../tidy&#8221;, &#8220;libtidy.so&#8221;)<br />
      rescue LoadError<br />
        begin<br />
          Tidy.path = File.join(File.dirname(__FILE__), &#8220;../tidy&#8221;, &#8220;libtidy.dll&#8221;)<br />
        rescue LoadError<br />
          Tidy.path = File.join(File.dirname(__FILE__), &#8220;../tidy&#8221;, &#8220;libtidy.dylib&#8221;)<br />
        end<br />
      end<br />
    end</p>
<p>I suggest you use a platform detection mechanism like so:</p>
<p>&#8220;RUBY_PLATFORM =~ /mswin32/&#8221;</p>
<p>And then the code will play more nicely.  Otherwise, just stick to &#8220;require &#8216;tidy&#8217;&#8221;, atleast then Scrapi will only have the same problem that all the other gems do :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The sixth sense - &#187; Mashups?Web ???????</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-140586</link>
		<dc:creator>The sixth sense - &#187; Mashups?Web ???????</dc:creator>
		<pubDate>Mon, 26 May 2008 06:20:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-140586</guid>
		<description>[...] Scraping with style: scrAPI toolkit for Ruby????? mashup ???????? [...]</description>
		<content:encoded><![CDATA[<p>[...] Scraping with style: scrAPI toolkit for Ruby????? mashup ???????? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Attack of the Website Scrapers &#124; The BookmarkMoney Blog</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-140555</link>
		<dc:creator>Attack of the Website Scrapers &#124; The BookmarkMoney Blog</dc:creator>
		<pubDate>Sun, 18 May 2008 09:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-140555</guid>
		<description>[...] Inside reported on scrAPI a while back. scrAPi is a Ruby-based HTML scraping toolkit written by Assaf [...]</description>
		<content:encoded><![CDATA[<p>[...] Inside reported on scrAPI a while back. scrAPi is a Ruby-based HTML scraping toolkit written by Assaf [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timo</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-140479</link>
		<dc:creator>Timo</dc:creator>
		<pubDate>Thu, 08 May 2008 14:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-140479</guid>
		<description>This has probably saved me a few hours of searching. Thanks, Assaf!</description>
		<content:encoded><![CDATA[<p>This has probably saved me a few hours of searching. Thanks, Assaf!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-140423</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 29 Apr 2008 11:44:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-140423</guid>
		<description>Nevermind, I figured it out, I was being stupid.</description>
		<content:encoded><![CDATA[<p>Nevermind, I figured it out, I was being stupid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/comment-page-2/#comment-140421</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 29 Apr 2008 03:48:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2006/07/11/scraping-with-style-scrapi-toolkit-for-ruby/#comment-140421</guid>
		<description>Hi, I really like what you&#039;ve put together here and am trying to use it in a project but am running into a little trouble.  I&#039;m trying to define a Scraper dynamically setting the selector for it based on a variable, but that doesn&#039;t seem to work.  Everything seems to be class methods so creating a new Scrapper class and setting instance variables doesn&#039;t work, putting the variable into a Scraper.define block doesn&#039;t work either because the contents of the block get evaluated later on and the variable used in the block has no meaning at that point.  Any idea how to get around this, any help at all would be really appreciate.</description>
		<content:encoded><![CDATA[<p>Hi, I really like what you&#8217;ve put together here and am trying to use it in a project but am running into a little trouble.  I&#8217;m trying to define a Scraper dynamically setting the selector for it based on a variable, but that doesn&#8217;t seem to work.  Everything seems to be class methods so creating a new Scrapper class and setting instance variables doesn&#8217;t work, putting the variable into a Scraper.define block doesn&#8217;t work either because the contents of the block get evaluated later on and the variable used in the block has no meaning at that point.  Any idea how to get around this, any help at all would be really appreciate.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
