Webview source code in blackberry10 - blackberry-10

Hi friends I am developing an application in Blackbery10 to parse the xml data in an html page. That the html is loaded in a webview and the html source contains some xml tags. Please help me to get the html source code of web view in blackberry10.

On the Webview you can use a function evaluateJavaScript (const QString &script, bb::cascades::JavaScriptWorld::Typeworld world) to execute a javascript function to get the text or xml you need. You should be able to evaluate the following expression:
return document.documentElement.innerHTML;
You can then retrieve the evaluated expression from the signal javaScriptResult

You cannot access the HTML of a WebView that was loaded from network
If you want an application highly based on HTML, you can have a look at WebWorks. If you still require the native framework, you have to request the content yourself, parse it, and then inject it into the webview.

Related

Is there any way to get the HTML from a web page once the JavaScript is loaded in a Flutter app?

I'm working on a URL preview widget, so I'd like to extract the meta tags from the HTML of a given URL.
However, the problem is that websites like Twitter don't return the entire HTML when they detect there's no JavaScript engine enabled (i.e. doing a GET request from the http package).
So, I'd like to know if there's any workaround for these cases, for example, using some kind of headless browser to get the entire HTML.
Thanks!

How to Verify a Page is loaded Succesully

Hi I have one url which will open the Page in XMl format. Now there is no any Style information for the page so when I am trying to use
assertTextPresent();
for the verification of a text on the page it showing error
Couldn't access document.body. Is this HTML page fully loaded?
Is there any other way to verify The Page is fully Loaded.
I am using Perl Language with Selenium RC.
I am using Open function for launching the page.
This is not basically a Perl question. Checking whether a page is loaded completely or not is a client side concern and you can use Javascript to tackle this. With AJAX, on XMLHTTPRequest object, check the status code of 4 and response code of 200, you are pretty much done.

Prefill web form with data stored in app

With the iPhone UiWebView is it possible to prefill an html form with username and other
account details that are stored in the app's data folder. Using iOS 5.1 sdk
So I would need to read the file with the customers's information stored and then prefill the web form from the UIWebView. I need to know if this can be done and if so any tutorials how to do it would be useful.
Thanks
You could read the data from your app's bundle then run a JavaScript function that takes the data as parameters and uses it to pre-populate the form.
You can execute the Javascript in your UIWebView by using the method
stringByEvaluatingJavaScriptFromString:
I'm not a JavaScript expert so I don't want to comment on the best way to write the JavaScript function to pre-populate the form but I know its possible.

Objective-C: Extract Text From a URL

I am wondering how i would go out onto the web and grab a body of text from a specific website, then display it to a user within my app. I got the whole display part, it is the grabbing text from a URL that has me stumped.
You can use TFHpple, a XPath Parser which allows you to parse HTML and other DOM documents
You want stringWithContentsOfURL.

Grab contents of a webpage in GWT

Let's say that I have a link to a webpage that contains some text. What's the easiest way to grab this text to process?
Thanks.
Long story short, I don't think it's possible to make a request from the client js to grab the text from a url with a different domain.
It is possible to make requests to load json. This link describes how.
Basically, the steps are:
Embed a tag in the GWT page
after GWT page is initialized, update
the script tag's src to load remote
url
remote url returns some json data
padded inside a callback javascript
function such as:
callback({blah:foo})
So, you're only option may be writing a method on the server side that loads the url, gets the text. You could then call this method from gwt client using normal rpc technique.
Assuming same origin: use the "RequestBuilder" class.
If you are trying to grab a webpage from a different origin, then it obviously won't work.