Get HTML from UI.webview
Is it possible to get the HTML from a loaded url in UI.Webview?
maybe by using eval_js ('document.documentElement.outerHTML'), but i have not tried this.
It does work- but needs some other stuff.
It isn't required to present the UI.view in order to do this, so what we have here is a very simple way in Pythonista to scrape a page that has generated content. I know it's possible with various headless browser modules- but the WebKit is already in UI.webview
Here's what I have that works:
webb = ui.WebView()
webb.load_url('your URL ')
js = 'document.documentElement.outerHTML'
reg = '' #some text to find to determine if page or script has been loaded/evaluated
html = webb.eval_js(js)
if re.findall(reg, html):