[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problems with scRUBYt

Cs Webgrl

12/30/2008 11:33:00 PM

Hi.

I am currently scraping a page with scRUBYt and am not getting the
results as expected.

Instead of the correctly formatted xml document I'm getting the
following.

<record>
<1>book a</1>
<1>book b</1>
<1>book c</1>
<2>chapter aa</2>
<2>chapter bb</2>
<2>chapter cc</2>
<3>verse aaa</3>
<3>verse bbb</3>
<3>verse ccc</3>
</record>

My code looks like this:

listing "//a[@id*='volume'>" do
book "//a[@class='1']"
chapter "//span[@class='2']"
verse "//a[@id*='3']"
end

Any ideas?

Sorry for the sample data, but hopefully someone has seen this before
and can help.
--
Posted via http://www.ruby-....

11 Answers

Aaron Patterson

12/31/2008 12:37:00 AM

0

On Wed, Dec 31, 2008 at 08:33:26AM +0900, Cs Webgrl wrote:
> Hi.
>
> I am currently scraping a page with scRUBYt and am not getting the
> results as expected.
>
> Instead of the correctly formatted xml document I'm getting the
> following.
>
> <record>
> <1>book a</1>
> <1>book b</1>
> <1>book c</1>
> <2>chapter aa</2>
> <2>chapter bb</2>
> <2>chapter cc</2>
> <3>verse aaa</3>
> <3>verse bbb</3>
> <3>verse ccc</3>
> </record>

This is a correctly formatted XML document. You just have numbers for
tag names.

> My code looks like this:
>
> listing "//a[@id*='volume'>" do
> book "//a[@class='1']"
> chapter "//span[@class='2']"
> verse "//a[@id*='3']"
> end
>
> Any ideas?

Have you tried something like this:

book "//2[@id='whatevs']"

That should get you access to the tags.

Hope that helps!

--
Aaron Patterson
http://tenderlovem...

Cs Webgrl

12/31/2008 1:02:00 AM

0

Aaron Patterson wrote:

>
> Have you tried something like this:
>
> book "//2[@id='whatevs']"
>
> That should get you access to the tags.


This gives me a ton of data, but now I have lost the specific pieces of
information that I'm looking for. Instead it looks like the output of
all of the sourced code on that page. Was I to change something else in
the code to get the specific piece of data that I need?

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

Obveeus

6/19/2014 6:25:00 PM

0



On 6/19/2014 1:45 PM, David wrote:
> On Thursday, June 19, 2014 1:14:29 PM UTC-4, Michael Black wrote:
>
>> Now it's back when I assumed lack of news about it meant it wasn't
>> returning, but it's now Celebrity. That's not going to improve the show,
>> though maybe it will raise viewership.
>
>> But maybe something was wrong with the basic concept, or having some guy
>> with a funny name I'd never heard of before (though I know see that one
>> can get outdoor equipment branded with his name) be the host.
>
> He had a popular show co-produced by Discovery and BBC. The one celebrity episode he did, with Will Ferrell, was fairly entertaining.
>
> I guess I'll watch the episodes with celebrities I want to see.


Sounds like a plan, but which celebrities would you actually want to
see? Zac Efron, Channing Tatum, and Deion Sanders are definitely NO for
me. Ben Stiller and Tom Arnold might be funny...or they might just
spend the whole time trying too hard to be funny. Tamron Hall as the
only female might be interesting, if she can avoid turning the episode
into a puff piece interview.

Anim8rFSK

6/19/2014 7:28:00 PM

0

In article <lnv9tn$rgm$1@dont-email.me>, Obveeus <Obveeus@aol.com>
wrote:

> On 6/19/2014 1:45 PM, David wrote:
> > On Thursday, June 19, 2014 1:14:29 PM UTC-4, Michael Black wrote:
> >
> >> Now it's back when I assumed lack of news about it meant it wasn't
> >> returning, but it's now Celebrity. That's not going to improve the show,
> >> though maybe it will raise viewership.
> >
> >> But maybe something was wrong with the basic concept, or having some guy
> >> with a funny name I'd never heard of before (though I know see that one
> >> can get outdoor equipment branded with his name) be the host.
> >
> > He had a popular show co-produced by Discovery and BBC. The one celebrity
> > episode he did, with Will Ferrell, was fairly entertaining.
> >
> > I guess I'll watch the episodes with celebrities I want to see.
>
>
> Sounds like a plan, but which celebrities would you actually want to
> see? Zac Efron, Channing Tatum, and Deion Sanders are definitely NO for
> me. Ben Stiller and Tom Arnold might be funny...or they might just
> spend the whole time trying too hard to be funny. Tamron Hall as the
> only female might be interesting, if she can avoid turning the episode
> into a puff piece interview.

Well, who I want to see depends on if there's actually a chance they
won't survive.

--
Wait - are you saying that ClodReamer was wrong, or lying?

Obveeus

6/19/2014 8:29:00 PM

0



On 6/19/2014 3:27 PM, anim8rFSK wrote:
> In article <lnv9tn$rgm$1@dont-email.me>, Obveeus <Obveeus@aol.com>
> wrote:
>
>> On 6/19/2014 1:45 PM, David wrote:
>>> On Thursday, June 19, 2014 1:14:29 PM UTC-4, Michael Black wrote:
>>>
>>>> Now it's back when I assumed lack of news about it meant it wasn't
>>>> returning, but it's now Celebrity. That's not going to improve the show,
>>>> though maybe it will raise viewership.
>>>
>>>> But maybe something was wrong with the basic concept, or having some guy
>>>> with a funny name I'd never heard of before (though I know see that one
>>>> can get outdoor equipment branded with his name) be the host.
>>>
>>> He had a popular show co-produced by Discovery and BBC. The one celebrity
>>> episode he did, with Will Ferrell, was fairly entertaining.
>>>
>>> I guess I'll watch the episodes with celebrities I want to see.
>>
>>
>> Sounds like a plan, but which celebrities would you actually want to
>> see? Zac Efron, Channing Tatum, and Deion Sanders are definitely NO for
>> me. Ben Stiller and Tom Arnold might be funny...or they might just
>> spend the whole time trying too hard to be funny. Tamron Hall as the
>> only female might be interesting, if she can avoid turning the episode
>> into a puff piece interview.
>
> Well, who I want to see depends on if there's actually a chance they
> won't survive.

If that is an option for the show, I nominate Bear-Grylls for the first
to be voted off.

Michael Black

6/19/2014 8:42:00 PM

0

Michael Black

6/19/2014 8:48:00 PM

0

David

6/19/2014 10:17:00 PM

0

On Thu, 19 Jun 2014 14:24:51 -0400, Obveeus <Obveeus@aol.com> wrote:

>On 6/19/2014 1:45 PM, David wrote:

>> I guess I'll watch the episodes with celebrities I want to see.

>Sounds like a plan, but which celebrities would you actually want to
>see? Zac Efron, Channing Tatum, and Deion Sanders are definitely NO for
>me. Ben Stiller and Tom Arnold might be funny...or they might just
>spend the whole time trying too hard to be funny.

I'd watch Stiller, Tatum and Arnold. Sanders might be interesting
depending on what the episode's challenge is, to see how an ex elite
athlete would measure up.

>Tamron Hall as the
>only female might be interesting, if she can avoid turning the episode
>into a puff piece interview.

Wasn't sure who she is. Eh, someone from the news wouldn't appeal to
me. Well maybe Brian Williams, who seems like a funny guy, or some
old/overweight windbag huffing and puffing up a mountain.

Ian J. Ball

6/20/2014 3:59:00 PM

0

In article <alpine.LNX.2.02.1406191312080.16630@darkstar.example.org>,
Michael Black <et472@ncf.ca> wrote:

> On Thu, 19 Jun 2014, David wrote:
>
> > NBC ORDERS NEW SERIES 'RUNNING WILD WITH BEAR GRYLLS,' SET TO PREMIERE
> > MONDAY, JULY 28
> >
> > Famed Adventurer/Survivalist to Take Zac Efron, Ben Stiller, Channing
> > Tatum, Deion Sanders, Tom Arnold and Tamron Hall on Life-Changing
> > Journeys
> >
> > NBC has ordered six episodes of the hourlong alternative series "Running
> > Wild with Bear Grylls," where the famed adventurer and survivalist will
> > take celebrities into the most remote and wild locations in the U.S. and
> > around the world for a 48-hour journey of a lifetime.
> >
> > The series will premiere Monday, July 28 (8-9 p.m. ET/PT).
> >
> The kiss of death. It had one season last year, and I don't remember much
> talk about it. I did watch the first few episodes, then tuned out, I
> think because "Under the Dome" was on at the same time, something was.
>
> Now it's back when I assumed lack of news about it meant it wasn't
> returning, but it's now Celebrity. That's not going to improve the show,
> though maybe it will raise viewership.

NBC is incapable of *not* doing celebrity-only reality shows.

Frankly, NBC should be *BANNED* from ever being allowed to air any
reality shows. Heck, I'd ban them from gameshows like "The Voice" too...

--
"Wait! - You can set your GPS to "tacos"?!" - Shawn, to Gus, in
"The Break-Up", the series finale to "Psych" (03-26-14)

Obveeus

6/20/2014 4:01:00 PM

0



On 6/20/2014 11:58 AM, Ian J. Ball wrote:
> In article <alpine.LNX.2.02.1406191312080.16630@darkstar.example.org>,
> Michael Black <et472@ncf.ca> wrote:
>
>> On Thu, 19 Jun 2014, David wrote:
>>
>>> NBC ORDERS NEW SERIES 'RUNNING WILD WITH BEAR GRYLLS,' SET TO PREMIERE
>>> MONDAY, JULY 28
>>>
>>> Famed Adventurer/Survivalist to Take Zac Efron, Ben Stiller, Channing
>>> Tatum, Deion Sanders, Tom Arnold and Tamron Hall on Life-Changing
>>> Journeys
>>>
>>> NBC has ordered six episodes of the hourlong alternative series "Running
>>> Wild with Bear Grylls," where the famed adventurer and survivalist will
>>> take celebrities into the most remote and wild locations in the U.S. and
>>> around the world for a 48-hour journey of a lifetime.
>>>
>>> The series will premiere Monday, July 28 (8-9 p.m. ET/PT).
>>>
>> The kiss of death. It had one season last year, and I don't remember much
>> talk about it. I did watch the first few episodes, then tuned out, I
>> think because "Under the Dome" was on at the same time, something was.
>>
>> Now it's back when I assumed lack of news about it meant it wasn't
>> returning, but it's now Celebrity. That's not going to improve the show,
>> though maybe it will raise viewership.
>
> NBC is incapable of *not* doing celebrity-only reality shows.
>
> Frankly, NBC should be *BANNED* from ever being allowed to air any
> reality shows. Heck, I'd ban them from gameshows like "The Voice" too...

I'd rather like to see them do a celebrity THE BIGGEST LOSER just so
they could clear a dozen or so fat actors down to more normal size.