Sorry, maybe I confused the issue. Are you looking for the map or something else? I was able to get the href and a click response (currently have the webdriver version installed and used firefox):
irb(main):005:0> b.link(:text, 'Map').href => "http://us.rd.yahoo.com/finance/profile/map/*http://maps.yahoo.com/maps_result?addr=One%20Microso ft%20Way&csz=Redmond%20WA%2098052-6399&country=United%20States" ________________________________ From: John Fitisoff <[email protected]> To: "[email protected]" <[email protected]> Sent: Tuesday, January 17, 2012 7:52 PM Subject: Re: [wtr-general] Hard to get to link 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] -- 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]
