Forum: Ruby Need script for the following problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Be0fb99c879ff825b22ea5bce32176de?d=identicon&s=25 Sita Rami Reddy (Guest)
on 2008-11-11 22:03
(Received via mailing list)
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
E088bb5c80fd3c4fd02c2020cdacbaf0?d=identicon&s=25 Jesús Gabriel y Galán (Guest)
on 2008-11-12 09:35
(Received via mailing list)
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.
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (Guest)
on 2008-11-12 10:07
(Received via mailing list)
2008/11/12 Jesús Gabriel y Galán <jgabrielygalan@gmail.com>:
>>
>> 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.

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-questions.html

robert
3e00403e6a08fc4499057d8be5b85709?d=identicon&s=25 Tom Morris (Guest)
on 2008-11-23 20:02
(Received via mailing list)
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/documentati... 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/16735>.

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-questions.html>)

Yours,
3e00403e6a08fc4499057d8be5b85709?d=identicon&s=25 Tom Morris (Guest)
on 2008-11-23 20:40
(Received via mailing list)
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/documentati... 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/16735>.

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-questions.html>)

Yours,
This topic is locked and can not be replied to.