Forum: Ruby How to get the values - "ipad,iPod" using "xpath:" concept?

Posted by Love U Ruby (my-ruby)
on 2013-01-25 12:17
Please find the part of an `html` :


       <ul id="globalnav" role="navigation">
        <li id="gn-apple"><a href="/"><span>Apple</span></a></li>
        <li id="gn-store"><a
href="http://store.apple.com/"><span>Store</span></a></l...
        <li id="gn-mac"><a href="/mac/"><span>Mac</span></a></li>
        <li id="gn-ipod"><a href="/ipod/"><span>iPod</span></a></li>
        <li id="gn-iphone"><a
href="/iphone/"><span>iPhone</span></a></li>
        <li id="gn-ipad"><a href="/ipad/"><span>iPad</span></a></li>
        <li id="gn-itunes"><a
href="/itunes/"><span>iTunes</span></a></li>
        <li id="gn-support" class="gn-last"><a
href="/support/"><span>Support</span></a></li>
      </ul>

Can we get the values `ipad,iPod` using `Selenium-webdriver-xpath`
concept?

Thanks,
Posted by Robert Klemme (robert_k78)
on 2013-01-25 12:31
(Received via mailing list)
On Fri, Jan 25, 2013 at 12:17 PM, Arup Rakshit <lists@ruby-forum.com> 
wrote:
> href="/iphone/"><span>iPhone</span></a></li>
>         <li id="gn-ipad"><a href="/ipad/"><span>iPad</span></a></li>
>         <li id="gn-itunes"><a
> href="/itunes/"><span>iTunes</span></a></li>
>         <li id="gn-support" class="gn-last"><a
> href="/support/"><span>Support</span></a></li>
>       </ul>
>
> Can we get the values `ipad,iPod` using `Selenium-webdriver-xpath`
> concept?

It's not clear what you want to use a selection criteria.  Is it

 - the text
 - the tag's name
 - an attribute value
 - an attribute's name
 - a combination

?

Cheers

robert
Posted by Love U Ruby (my-ruby)
on 2013-01-25 12:39
Robert Klemme wrote in post #1093735:

>
> It's not clear what you want to use a selection criteria.  Is it
>
>  - the text
>  - the tag's name
>  - an attribute value
>  - an attribute's name
>  - a combination
>
> ?


I want to get the values as mentioned in the subject using `xpath` with 
selenium-webdriver. Any logic is fine,but need to extract the fields 
information's.
Posted by Robert Klemme (robert_k78)
on 2013-01-25 13:49
(Received via mailing list)
On Fri, Jan 25, 2013 at 12:39 PM, Arup Rakshit <lists@ruby-forum.com> 
wrote:
>>
>> ?
>
>
> I want to get the values as mentioned in the subject using `xpath` with
> selenium-webdriver. Any logic is fine,but need to extract the fields
> information's.

That does not answer my questions.  You want to get those values based
on _what_?  As long as you do not describe the criteria I will happily
implement

def get; %w{ipad iPod} end

Cheers

robert
Posted by Love U Ruby (my-ruby)
on 2013-01-25 14:40
Robert Klemme wrote in post #1093743:
> On Fri, Jan 25, 2013 at 12:39 PM, Arup Rakshit <lists@ruby-forum.com>
> wrote:
>>>
>>> ?
>>


Here is my answer

It's not clear what you want to use a selection criteria.  Is it

 - the text
 - the tag's name (yes)
 - an attribute value(yes)
 - an attribute's name(yes)
 - a combination(yes)

Please help.
Posted by Panagiotis Atmatzidis (Guest)
on 2013-01-25 15:18
(Received via mailing list)
On 25 Ιαν 2013, at 12:17 , Arup Rakshit <lists@ruby-forum.com> wrote:

> href="/iphone/"><span>iPhone</span></a></li>
> Thanks,
>
> --
> Posted via http://www.ruby-forum.com/.
>

There are a lot of ruby tools that can do that. Nokogiri can do it 
easily. Watch this: 
http://railscasts.com/episodes/190-screen-scraping...

Panagiotis (atmosx) Atmatzidis

email:  atma@convalesco.org
URL:  http://www.convalesco.org
GnuPG ID: 0xE736C6A0
gpg --keyserver x-hkp://pgp.mit.edu --recv-keys 0xE736C6A0
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.