[wtr-general] Re: Skip external links

2015-07-02 Thread Justin Ko
Instead of building a collection of all links on the page, ie doing `browser.links`, you can use locators to build a collection of certain links. In this case, you would want to be filtering links based on the :href. For example, the collection would be `browser.links(href: /mysite\.com/)`. He

[wtr-general] Re: Skip external links

2015-06-30 Thread John Fitisoff
To get the href you can use link.attribute_value(:href) To match against https://mysite.com you could use a regular expression: b.links[0].attribute_value(:href) =~ %r{https://mysite.com.*} which will return a number specifying the match position within the string (if there's a match) or nil (i