Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Finds a link element with text matching the expression supplied. Expressions must
- * begin with "link:".
- */
- BrowserBot.prototype.locateElementByLinkText = function(linkText, inDocument, inWindow) {
- var links = inDocument.getElementsByTagName('a');
- for (var i = 0; i < links.length; i++) {
- var element = links[i];
- if (PatternMatcher.matches(linkText, getText(element))) {
- return element;
- }
- }
- return null;
- };
- BrowserBot.prototype.locateElementByLinkText.prefix = "link";
Add Comment
Please, Sign In to add comment