12-28-2012 04:00 AM
How can I get all ressources web from url without display the web page
i.e I have page test.html contain in the code source page.css, pic.png, file.js
How can I get all this files without display the page just from the url http://.............test.html
12-28-2012 06:52 AM
If I understand your question correctly, you want to download the 'source' of an HTML page, and then also download yourself all the 'embedded' resources, like the CSS and image files that are referenced in the source..
The only way I have done this is to download the HTML file - which you can do using code like the code in htmlDemo sample, and then parser the downloaded source looking for the links and other references to external resources, then download these yourself.
This works but requires that you understand all the possible references that might exist in an HTML page.
Alternatively you may be able to do this using a BrowserField that is not displayed on the screen. I don't know if this will actually start the download for the page even when it is not displayed. I suspect it will but I have not tested it..
Assuming this does actually download the page, then you can create a BrowserController for this, then in the
method you can decide how you want to treat the URI that the page is requesting.
If you search on the forum using the keywords "BrowserField sample" you will find a few KB articles that should help you get started with this approach.
12-28-2012 08:53 AM
As I said, I believe you can create a BrowserField that is not displayed.
I would suggest that you create a BrowserField, and add it to a Screen and see what happens. Do not push the screen, so the BrowserField will never therefore be seen.
So the BrowserField is created and is on a screen - the screen is not physically displayed on the device, but perhaps that is enough for the processing to start downloading the files.