Oh my, JavaScript indeed slipped my mind for a second. But this is also not the only problem because a lot of web pages are generated on a per-user basis, so one and the same URL won't look like the same on another client (think of logins).
Anyway. You could inject JavaScript into the WebView that displays the website you want to copy. This can be done by setting a URL on the WebView which is prefixed with the "javascript:" protocol followed by the "trojan" JavaScript code. Use your JavaScript code to serialize a copy of the DOM node tree and pass that information over to your app. You can write an Android interface which you can call from JavaScript<http://developer.android.com/guide/webapps/webview.html#BindingJavaScript>within a WebView. I am unfortunately not familiar with that Pocket app so I don't know what it exactly does. On Wednesday, June 20, 2012 7:30:17 PM UTC-5, VP wrote: > > Hi Nobu Games, > > Thanks for your reply. However I already tried using the user-agent string > returned by Android to download content from URL. This however did not work > since the returned webpage says that javascript is not enabled on your > browser. I tried on url: www.techcrunch.com and www.cnet.com. > > The use case of my application is as follows: > > The user uses any third party application (like News reader/Pulse etc) to > read some content and want to share. He shares the URL link of this content > with my application. Here I want to download this web-content and upload it > to some server. However I cannot use HTTP GET method to download the > content since it does not return proper content of the URL. Hence I am > using WebView to render/download this content. Now I want to save this > content displayed in the WebView and upload it to some server. > > Basically my requirement is the same as the Pocket (Readitlater > http://getpocket.com/). I want to save a webpage for offline consumption. > > > Is there a way to achieve this? > > Thanks, > > > On Wed, Jun 20, 2012 at 5:08 PM, Nobu Games <[email protected]>wrote: > >> You can retrieve the user agent >> string<http://developer.android.com/reference/android/webkit/WebSettings.html#getUserAgentString%28%29>from >> the WebView. Add that string as a user agent header to your request >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

