You probably want to avoid xpath. I've never once needed to use it with Watir. 
If you need to you can use multiple selectors or daisy-chain elements.


ie.goto('http://finance.yahoo.com/q/hp?s=MSFT')
ie.link(:text, 'Profile').click



________________________________
 From: mdwin01 <[email protected]>
To: Watir General <[email protected]> 
Sent: Tuesday, January 17, 2012 7:02 PM
Subject: [wtr-general] Hard to get to link
 
Hi-

Could someone help me get to the link for company address on Yahoo
Finance profile page?

Thank you,

Mark


require 'watir'
ie = Watir::IE.new
ie.goto("http://finance.yahoo.com/q/hp?s=MSFT+Profile";)

#puts ie.link(:xpath,"//a[contains(@href,'country=')]/").href
#puts ie.link(:xpath, "/html/body/div[3]/div[4]/table[2]/tbody/tr[2]/
td/a").href
#puts ie.link(:url, /country/).href
#puts ie.cell(:class, "yfnc_modtitlew1").link(:url, /country/).href

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to