1. Tom Holscher
  2. PowerBuilder
  3. Wednesday, 19 May 2021 13:28 PM UTC

Hello,

how can i get the innerhtml and/or the inner text from a webbrowser Object?

I Have tried this:

this.navigate( "javascript: " + ls_innerhtml + " = document.documentElement.innerHTML; void 0;")

 

Kind Regards, Tom Holscher

Accepted Answer
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 23 September 2021 13:24 PM UTC
  2. PowerBuilder
  3. # Permalink
Use wb_1.EvaluateJavascriptSync("document.body.innerHTML;", ls_result)
Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 19 May 2021 13:56 PM UTC
  2. PowerBuilder
  3. # 1

Hi Tom,

Your code will not work because you can't mix PowerBuilder and JavaScript code.

But in PB 2019 R3 there are new EvaluateJavaScriptSync or EvaluateJavaScriptAsync functions.

https://docs.appeon.com/pb2019r3/objects_and_controls/ch02s150.html

You can use it to run JavaScript and return the result to PowerBuilder. See the examples in the help.

You can also use it for the other functionality you asked in https://community.appeon.com/index.php/qna/q-a/change-fontsize-in-an-webbrowser-object

HTH,

René

 

 

Comment
  1. Tom Holscher
  2. Thursday, 20 May 2021 08:53 AM UTC
Hello René,

i tried this:

STRING ls_result

wb_1.EvaluateJavascriptSync("{return (document.body.innerHTML)};", ls_result)



but the string is emptry
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.