Created
          January 5, 2020 15:11 
        
      - 
      
- 
        Save daniel12fsp/138931cc265b09c8d6297358dec0a0ce to your computer and use it in GitHub Desktop. 
    Search node by content(javascript)
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const xpath = "//a[contains(text(),'text')]"; | |
| const matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment