Results 1 to 5 of 5

Thread: Possible to retrieve generated html from webview?

  1. #1
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,198

    Possible to retrieve generated html from webview?

    I'd like to "grab" the generated HTML from an .rsp webview. It is possible, and how?

    thanks,

    Hank

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,385
    Blog Entries
    22
    Currently not. The "html" property on the WebView is currently write-only. Reading it is problematic if it contains html that is generated internally by javascript which is the case with JQM, JQuery, knockout.js and other frameworks which manipulate the DOM injecting HTML based on async callbacks completing.

    There is no standard way of doing this as the DOM may be ready but javascript frameworks may not have completed their work.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,385
    Blog Entries
    22
    If you just want to print it or generate a pdf there are methods on the WebView for that.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,385
    Blog Entries
    22
    Oh and also there is a evaluate() method on the WebView that will execute some JavaScript inside the WebView, so you could put some code in that returned the document.

    myhtml = Lianja.GetElementByID("mywebview").webview.evaluat e("my_javascript_function();")
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,198
    Quote Originally Posted by barrymavin View Post
    Oh and also there is a evaluate() method on the WebView that will execute some JavaScript inside the WebView, so you could put some code in that returned the document.

    myhtml = Lianja.GetElementByID("mywebview").webview.evaluat e("my_javascript_function();")
    Great: that should work. There is no js working in the dom here.

    thanks,

    Hank

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us