Development hpricot breaks code

L

lrlebron

I was using this simple script to parse some links from a web page

require 'open-uri'
require 'hpricot'

strLink = "http://sportsline.com/nfl/scoreboard/2006/week9"

@Doc = Hpricot(open(strLink))

@doc.search("a").each do |a|

if a.inner_html.include?"GameCenter"
puts 'http://sportsline.com' + a.attributes['href']
end

end

The script worked fine with the stable gem (0.4) but breaks with the
development gem (4.76). Unfortunately, I cannot find any documentation
that tells me what has changed between them

Any ideas would be greatly appreciated.

thanks,

Luis
 
L

lrlebron

Positive. The script works correctly with include? Does not work with
index.

Luis said:
I was using this simple script to parse some links from a web page

require 'open-uri'
require 'hpricot'

strLink = "http://sportsline.com/nfl/scoreboard/2006/week9"

@doc = Hpricot(open(strLink))

@doc.search("a").each do |a|

if a.inner_html.include?"GameCenter"
puts 'http://sportsline.com' + a.attributes['href']
end

end

Are sure you want to use 'include?' and not 'index' ?

T.
 
W

_why

The script worked fine with the stable gem (0.4) but breaks with the
development gem (4.76). Unfortunately, I cannot find any documentation
that tells me what has changed between them

Hey, thanks, this was a problem with script tags found inside javascript blocks.
Speaking particularly of, uh, this here at line 534:

<SCRIPT LANGUAGE="JavaScript">
var tcdacmd="dt";
if (switchTacoda != 'off') {
document.write('<script src="http://an.tacoda.net/an/12026/slf.js"
language="JavaScript"><\/script>');
}
</SCRIPT>

This is fixed in the repository. Can you checkout from
http://code.whytheluckystiff.net/svn/hpricot/trunk and see if it has healed??
Doing `rake install` will make the gem and install it.

_why
 
L

lrlebron

_why said:
Hey, thanks, this was a problem with script tags found inside javascript blocks.
Speaking particularly of, uh, this here at line 534:

<SCRIPT LANGUAGE="JavaScript">
var tcdacmd="dt";
if (switchTacoda != 'off') {
document.write('<script src="http://an.tacoda.net/an/12026/slf.js"
language="JavaScript"><\/script>');
}
</SCRIPT>

This is fixed in the repository. Can you checkout from
http://code.whytheluckystiff.net/svn/hpricot/trunk and see if it has healed??
Doing `rake install` will make the gem and install it.

_why

After I figured out how to get the svn code in my windows box I ran the
rake install and get the following error

rake package
rake aborted!
undefined method `exitstatus' for nil:NilClass
C:/temp2/hpricot/rakefile:169
(See full trace by running task with --trace)

thanks,

Luis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
VinayKumar Nevatia
Top