Page 1 of 1
How to get the source code of a page in native browser
Posted: Tue Feb 19, 2013 3:40 pm
by fredericBUSjJet
Hello All.
i would like to try to get the content of a native broswer page i've created with " iphoneControlCreate "browser" when the " on browserFinishedLoading pUrl " is handled
anyone can give me the syntax ?
thanks a lot
fred
Re: How to get the source code of a page in native browser
Posted: Tue Feb 19, 2013 5:37 pm
by endernafi
Hi Frederic,
Well, that's easy.
I love LiveCode
Code: Select all
on browserFinishedLoading pUrl
answer url(pUrl)
-- or
put url(pUrl) into url("file:" & specialFolderPath("cache") & "/theSourceCode.txt")
end browserFinishedLoading
Hope it helps...
Best,
~ Ender Nafi
Re: How to get the source code of a page in native browser
Posted: Tue Feb 19, 2013 6:35 pm
by fredericBUSjJet
got it. thanks so much.
i <3 too livecode
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 6:50 pm
by fredericBUSjJet
sorry another detail
i would like to put a button beside my browser field to get the sources of the browser content at anytime without reloading the page
do you have any idea ?
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 6:56 pm
by endernafi
Hi Frederic,
Put this into your button's script:
Code: Select all
on mouseUp
put "http://www.example.com/" into tUrl
answer url(tUrl)
-- or
put url(tUrl) into url("file:" & specialFolderPath("cache") & "/theSourceCode.txt")
end mouseUp
Best,
~ Ender Nafi
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 7:00 pm
by endernafi
This one's better:
Code: Select all
on mouseUp
put mobileControlGet("myNativeBrowser", "url") into tUrl
answer url(tUrl)
-- or
put url(tUrl) into url("file:" & specialFolderPath("cache") & "/theSourceCode.txt")
end mouseUp
Replace
myNativeBrowser with the name of your browser control
Best,
~ Ender Nafi
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 7:00 pm
by fnajmanBUSNPJd
thanks but the web site i am trying to get sources is in ajax and i would like to get the content of the page at different time when i am browsing in
something like " put iphonecontrolGet(sbrowserid, "text") into fld myTextField " maybe
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 7:05 pm
by endernafi
Look at my second post...
{ put mobileControlGet("myNativeBrowser", "url") into tUrl }
If this doesn't work for you then I didn't understand what you actually mean, sorry...
Best,
~ Ender Nafi
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 7:09 pm
by fnajmanBUSNPJd
thanks a lot for your help , i am sorry about my poor english
in fact the content is in javascript and ajax i guess
so content is dynamic inside the page
if i get the sources code i don't see the dynamic content in fact.
idea: is it possible to do a copy - paste inside a native browser ?
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 7:14 pm
by endernafi
There may be some workarounds.
Could you post the link whose content you're trying to retrieve?
I could give a try, then.
~ Ender Nafi
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 9:46 pm
by fnajmanBUSNPJd
thank you so much
i don't have permission to post link i hope you can understand this one
www(dot)demo(dot)index-education(dot)net/eleve.html
Re: How to get the source code of a page in native browser
Posted: Tue Mar 19, 2013 11:29 pm
by endernafi
Hi Frederic,
Well, I'm sorry to request the link;
I didn't realize that it may be a special web service.
I thought that it's a generic webpage
I managed to get the content
and although the code of that web service is obfuscated, the data can be processed.
Since the subject is no longer directly related to iOS, we should continue this discussion off-list.
Please contact me at
endernafi@gmail.com, I'll try to help - if I can

-
If we could generate an over-all solution, we'll post it here.
Best,
~ Ender Nafi