<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blogging and scraping</title>
	<atom:link href="http://www.tsnpc.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tsnpc.com</link>
	<description></description>
	<lastBuildDate>Tue, 13 Jul 2010 10:27:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>install firewatir on ubuntu 10.04</title>
		<link>http://www.tsnpc.com/install-firewatir-on-ubuntu-10-04/</link>
		<comments>http://www.tsnpc.com/install-firewatir-on-ubuntu-10-04/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 22:53:04 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/?p=216</guid>
		<description><![CDATA[I am a newbie with ubuntu, I tried and failed several times to install firewatir on ubuntu 10.04, and finally got following codes by google: sudo su apt-get install build-essential apt-get install ruby rdoc libopenssl-ruby wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz tar zxvf rubygems-1.3.7.tgz cd rubygems-1.3.7 ruby setup.rb ln -s /usr/bin/gem1.8 /usr/local/bin/gem gem install firewatir Frankly I did not [...]]]></description>
			<content:encoded><![CDATA[<p>I am a newbie with ubuntu,  I tried and failed several times to install firewatir on ubuntu 10.04, and finally got following codes by google:<br />
<code><br />
sudo su<br />
apt-get install build-essential<br />
apt-get install ruby rdoc libopenssl-ruby<br />
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz<br />
tar zxvf rubygems-1.3.7.tgz<br />
cd rubygems-1.3.7<br />
ruby setup.rb<br />
ln -s /usr/bin/gem1.8 /usr/local/bin/gem<br />
gem install firewatir<br />
</code></p>
<p>Frankly I did not understand the function of the first 2 apt-get, I just copy it for free.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/install-firewatir-on-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The poor support of the firewatir 1.6.5 to Chinese characters</title>
		<link>http://www.tsnpc.com/the-poor-support-of-the-firewatir-1-6-5-to-chinese-characters/</link>
		<comments>http://www.tsnpc.com/the-poor-support-of-the-firewatir-1-6-5-to-chinese-characters/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 09:05:41 +0000</pubDate>
		<dc:creator>leleba</dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[Chinese characters]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/the-poor-support-of-the-firewatir-1-6-5-to-chinese-characters/</guid>
		<description><![CDATA[I cannot figure out how to enter the Chinese characters into the textfield of a webpage by firewatir 1.6.5, I tried to change the encoding of the .rb file and the encoding of the firefox browser, but failed. require &#8216;rubygems&#8217; require &#8216;firewatir&#8217; ff = FireWatir::Firefox.new ff.goto &#8220;http://www.google.com&#8220; sleep 1 ff.text_field(:name, &#8216;q&#8217;).set(&#8216;?&#8217;) For Watir 1.6.5, the [...]]]></description>
			<content:encoded><![CDATA[<p>I cannot figure out how to enter the Chinese characters into the textfield of a webpage by firewatir 1.6.5, I tried to change the encoding of the .rb file and the encoding of the firefox browser, but failed.</p>
<p>require &#8216;rubygems&#8217; <br/>require &#8216;firewatir&#8217;</p>
<p>ff = FireWatir::Firefox.new <br/>ff.goto &#8220;<a href="http://www.google.com">http://www.google.com</a>&#8220;</p>
<p>sleep 1 <br/>ff.text_field(:name, &#8216;q&#8217;).set(&#8216;?&#8217;)</p>
<p>For Watir 1.6.5, the Chinese charaters can be supported by replacing the script WIN32OLE.codepage = WIN32OLE::CP_UTF8 with WIN32OLE.codepage = WIN32OLE::CP_ACP in the file of C:\Ruby\lib\ruby\gems\1.8\gems\watir-1.6.5\lib\watir\win32ole.rb <br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/the-poor-support-of-the-firewatir-1-6-5-to-chinese-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check the version of the watir and the firewatir</title>
		<link>http://www.tsnpc.com/check-the-version-of-the-watir-and-the-firewatir/</link>
		<comments>http://www.tsnpc.com/check-the-version-of-the-watir-and-the-firewatir/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 08:35:14 +0000</pubDate>
		<dc:creator>leleba</dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/check-the-version-of-the-watir-and-the-firewatir/</guid>
		<description><![CDATA[We can check the version of the watir and firewatir by executing an rb file with the following script: require &#8216;watir&#8217; require &#8216;firewatir&#8217; puts Watir::IE::VERSION puts FireWatir::Firefox::VERSION]]></description>
			<content:encoded><![CDATA[<p>We can check the version of the watir and firewatir by executing an rb file with the following script:</p>
<p>require &#8216;watir&#8217;</p>
<p>require &#8216;firewatir&#8217;</p>
<p>puts Watir::IE::VERSION</p>
<p>puts FireWatir::Firefox::VERSION</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/check-the-version-of-the-watir-and-the-firewatir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It is safe require &#8220;rubygems&#8221; in the begining of the watir codes</title>
		<link>http://www.tsnpc.com/it-is-safe-require-rubygems-in-the-begining-of-the-watir-codes/</link>
		<comments>http://www.tsnpc.com/it-is-safe-require-rubygems-in-the-begining-of-the-watir-codes/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 04:39:10 +0000</pubDate>
		<dc:creator>leleba</dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/it-is-safe-require-rubygems-in-the-begining-of-the-watir-codes/</guid>
		<description><![CDATA[Maybe it is safe to add the code of require &#8216;rubygems&#8217; in the beginning of the watir codes, otherwise, strange results may happen sometimes .]]></description>
			<content:encoded><![CDATA[<p>Maybe it is safe to add the code of require &#8216;rubygems&#8217; in the beginning of the watir codes, otherwise, strange results may happen sometimes .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/it-is-safe-require-rubygems-in-the-begining-of-the-watir-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the fucntion ie.collect in watir</title>
		<link>http://www.tsnpc.com/the-fucntion-ie-collect-in-watir/</link>
		<comments>http://www.tsnpc.com/the-fucntion-ie-collect-in-watir/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 00:44:51 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[collect]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/?p=207</guid>
		<description><![CDATA[Just copy a coding found in the internet for future reference, $ie.divs.collect {&#124;div&#124; if div.class_name == &#8220;data&#8221; puts div.text end }]]></description>
			<content:encoded><![CDATA[<p>Just copy a coding found in the internet for future reference,</p>
<p>$ie.divs.collect {|div|<br />
if div.class_name == &#8220;data&#8221;<br />
   puts div.text<br />
end<br />
} </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/the-fucntion-ie-collect-in-watir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The fast way to fill a textfield in watir</title>
		<link>http://www.tsnpc.com/the-fast-way-to-fill-a-textfield-in-watir/</link>
		<comments>http://www.tsnpc.com/the-fast-way-to-fill-a-textfield-in-watir/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:30:55 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[text field]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/?p=205</guid>
		<description><![CDATA[It is quite slow to fill a text field by ie.text_field().set(content), the fast way is by ie.text_field().value = content.]]></description>
			<content:encoded><![CDATA[<p>It is quite slow to fill a text field by ie.text_field().set(content), the fast way is by ie.text_field().value = content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/the-fast-way-to-fill-a-textfield-in-watir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>There is no property of class for iframe in watir</title>
		<link>http://www.tsnpc.com/there-is-no-property-of-class-for-iframe-in-watir/</link>
		<comments>http://www.tsnpc.com/there-is-no-property-of-class-for-iframe-in-watir/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 15:21:24 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[property]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/?p=202</guid>
		<description><![CDATA[I encountered an iframe in a webpage which say &#8220;iframe class = &#8220;the_iframe&#8221;, I tried but failed to access the iframe by: ie.frame(:class, &#8220;the_iframe&#8221;) and then I figured out there is no property of class for iframe in watir, and find the iframe by index: ie.frame(:index, 1) we can use ie.show_frames to find how many [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered an iframe in a webpage which say &#8220;iframe class = &#8220;the_iframe&#8221;, I tried but failed to access the iframe by:<br />
ie.frame(:class, &#8220;the_iframe&#8221;)</p>
<p>and then I figured out there is no property of class for iframe in watir, and find the iframe by index:<br />
ie.frame(:index, 1)</p>
<p>we can use ie.show_frames to find how many frames are there in a webpage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/there-is-no-property-of-class-for-iframe-in-watir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be careful to &#8220;include Watir&#8221;</title>
		<link>http://www.tsnpc.com/be-careful-to-include-watir/</link>
		<comments>http://www.tsnpc.com/be-careful-to-include-watir/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 06:12:39 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[include Watir]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/?p=199</guid>
		<description><![CDATA[When we have the &#8220;include Watir&#8221;, then we cannot load another ruby file. I spent more than 1 hour to figure out this.]]></description>
			<content:encoded><![CDATA[<p>When we have the &#8220;include Watir&#8221;, then we cannot load another ruby file.</p>
<p>I spent more than 1 hour to figure out this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/be-careful-to-include-watir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple ruby files work together</title>
		<link>http://www.tsnpc.com/multiple-ruby-files-work-together/</link>
		<comments>http://www.tsnpc.com/multiple-ruby-files-work-together/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 04:06:05 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[multiple ruby files]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/?p=196</guid>
		<description><![CDATA[When writing the first few Ruby programs, there is a tend to place all the code in a single file. But as time passes by and the Ruby programs grow, it is nature that at some point we have to break our code up into logical groupings and place each group in a separate file [...]]]></description>
			<content:encoded><![CDATA[<p>When writing the first few Ruby programs, there is a tend to place all the code in a single file. But as time passes by and the Ruby programs grow, it is nature that at some point we have to break our code up into logical groupings and place each group in a separate file or files. </p>
<p>following is an examle:</p>
<p>in foo.rb:<br />
puts &#8220;it is foo&#8221;<br />
$foo = 3  # $ for global variable</p>
<p>in bar.rb:<br />
puts &#8220;it is bar&#8221;<br />
$bar = 3  # $ for global variable</p>
<p>in test.rb:<br />
require &#8216;foo&#8217; # pay attention &#8211;no &#8220;.rb&#8221;<br />
load &#8216;bar.rb&#8217; # pay attention &#8212; &#8220;.rb&#8221; is there<br />
test = 1 + $foo + $bar</p>
<p>when execute test.rb, it shows :<br />
it is foo<br />
it is bar<br />
9</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/multiple-ruby-files-work-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>watir to count the links in a search list on a webpage</title>
		<link>http://www.tsnpc.com/watir-to-count-the-links-in-a-search-list-on-a-webpage/</link>
		<comments>http://www.tsnpc.com/watir-to-count-the-links-in-a-search-list-on-a-webpage/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 11:10:25 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[find_all]]></category>
		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://www.tsnpc.com/?p=190</guid>
		<description><![CDATA[Some times I need to check the amount of the links in a search list, at first I try and failed by: ie.links(:id, /bra bra/).length and then I find a solution by: ie.div(:id, &#8220;searchList&#8221;).links and then by googles, I find a better solution: links_searchlist = ie101.links.find_all { &#124;link&#124; link.class_name == &#8216;permalink&#8217; } puts &#8220;the links [...]]]></description>
			<content:encoded><![CDATA[<p>Some times I need to check the amount of the links in a search list, at first I try and failed by:<br />
ie.links(:id, /bra bra/).length</p>
<p>and then I find a solution by:<br />
ie.div(:id, &#8220;searchList&#8221;).links</p>
<p>and then by googles, I find a better solution:<br />
links_searchlist = ie101.links.find_all { |link| link.class_name == &#8216;permalink&#8217; }<br />
puts &#8220;the links in the searchlist:&#8221;<br />
puts links_searchlist.length</p>
<p>and in another case, following code also works:<br />
searchlistlinks = ie102.links.find_all { |link| link.id =~ /hitURL/ }<br />
links_searchlist = searchlistlinks.length<br />
puts links_searchlist</p>
<p>following can also work:<br />
searchlistlinks = ie33.links.find_all { |link| link.href =~ /something/ }<br />
but be careful that the following (url) will not work:<br />
searchlistlinks = ie33.links.find_all { |link| link.url =~ /something/ }</p>
<p>Recently I found the best solution by google:<br />
links = ie51.div(:id, ‘threadlist’).html.scan(/something/).count<br />
puts links</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tsnpc.com/watir-to-count-the-links-in-a-search-list-on-a-webpage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

