[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Need script for the following problem

Sita Rami Reddy

11/11/2008 9:01:00 PM

[Note: parts of this message were removed to make it a legal post.]

Hi,
My problem is folows

Opened google and entered pickaxe and clicked search

in the page followed, i want to collect all the page titles which are in
green color and all the corresponding links in a log file.
i want to repeat the same for 10 pages(google searched) ..

please help me

--
Sita Rami Reddy P

4 Answers

Jesús Gabriel y Galán

11/12/2008 8:32:00 AM

0

On Tue, Nov 11, 2008 at 10:00 PM, Sita Rami Reddy
<sitaramireddy@gmail.com> wrote:
> Hi,
> My problem is folows
>
> Opened google and entered pickaxe and clicked search
>
> in the page followed, i want to collect all the page titles which are in
> green color and all the corresponding links in a log file.
> i want to repeat the same for 10 pages(google searched) ..
>
> please help me

Take a look at mechanize, or search the archives or google for "web scraping".
There's a lot of info out there. If you get stuck with something just
let us know,
post some code and we'll help you.

Jesus.

Robert Klemme

11/12/2008 9:03:00 AM

0

2008/11/12 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan@gmail.com>:
> On Tue, Nov 11, 2008 at 10:00 PM, Sita Rami Reddy
> <sitaramireddy@gmail.com> wrote:
>> Hi,
>> My problem is folows
>>
>> Opened google and entered pickaxe and clicked search
>>
>> in the page followed, i want to collect all the page titles which are in
>> green color and all the corresponding links in a log file.
>> i want to repeat the same for 10 pages(google searched) ..
>>
>> please help me
>
> Take a look at mechanize, or search the archives or google for "web scrap=
ing".
> There's a lot of info out there. If you get stuck with something just
> let us know,
> post some code and we'll help you.

Sita, to make it crystal clear: this is not the service "We code it
for you" with its free new subscribers offer. You'll have to invest a
bit more to get your problem solved (either you hand it off to a
contractor which I am sure will happily provide what you need and bill
you or start writing it yourself and see how far you get).

Terms of usage can be found at
http://www.catb.org/~esr/faqs/smart-ques...

robert


--=20
remember.guy do |as, often| as.you_can - without end

Tom Morris

11/23/2008 6:56:00 PM

0

On 2008-11-11, Sita Rami Reddy <sitaramireddy@gmail.com> wrote:
> Opened google and entered pickaxe and clicked search
>
> in the page followed, i want to collect all the page titles which are in
> green color and all the corresponding links in a log file.
> i want to repeat the same for 10 pages(google searched) ..
>

That's a particularly efficient way of doing it. Google actually has an
API. You can use it with two Ruby gems: curb and json.

See <http://code.google.com/apis/ajaxsearch/documentation/... for
details on how to use Google's API. I have some example code up for how
to do this in Ruby here <http://gist.github.com....

You'll have to use your own initiative from here on out (preferably
following How To Ask Questions The Smart Way at:
<http://www.catb.org/~esr/faqs/smart-question...)

Yours,

--
Tom Morris
<http://tommorr...

Tom Morris

11/23/2008 7:38:00 PM

0

On 2008-11-11, Sita Rami Reddy <sitaramireddy@gmail.com> wrote:
> Opened google and entered pickaxe and clicked search
>
> in the page followed, i want to collect all the page titles which are in
> green color and all the corresponding links in a log file.
> i want to repeat the same for 10 pages(google searched) ..
>

That's a particularly inefficient way of doing it. Google actually has an
API. You can use it with two Ruby gems: curb and json.

See <http://code.google.com/apis/ajaxsearch/documentation/... for
details on how to use Google's API. I have some example code up for how
to do this in Ruby here <http://gist.github.com....

You'll have to use your own initiative from here on out (preferably
following How To Ask Questions The Smart Way at:
<http://www.catb.org/~esr/faqs/smart-question...)

Yours,

--
Tom Morris
<http://tommorr...