Guest User

Untitled

a guest
Jan 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. /**
  2. * Finds a link element with text matching the expression supplied. Expressions must
  3. * begin with "link:".
  4. */
  5. BrowserBot.prototype.locateElementByLinkText = function(linkText, inDocument, inWindow) {
  6. var links = inDocument.getElementsByTagName('a');
  7. for (var i = 0; i < links.length; i++) {
  8. var element = links[i];
  9. if (PatternMatcher.matches(linkText, getText(element))) {
  10. return element;
  11. }
  12. }
  13. return null;
  14. };
  15.  
  16. BrowserBot.prototype.locateElementByLinkText.prefix = "link";
Add Comment
Please, Sign In to add comment