Forum Discussion

martin_woolf's avatar
11 years ago

Capture text from webpage

HI,



I'm a new user and am looking for a way to capture text from a webpage into a VBA variable.

Do I  have to get it from the source code? If I have to capture all the source code, that's fine as I can extract what I need in the script.  



Any suggestions.



Thanks



Martin

2 Replies

  • It seems that page.contentDocument.documentElement.innerText or page.contentDocument.documentElement.textContent is what you need.
  • if you just need to capture some values on the page, and not the whole page, you can use a Log Event to capture the object's text property as well. If you running a loop test, it captures the data on each cycle and creates a log entry in the test results.