How to get the source code of a page in native browser
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 4
- Joined: Mon Feb 18, 2013 4:01 pm
How to get the source code of a page in native browser
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
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
Hi Frederic,
Well, that's easy.
I love LiveCode
Hope it helps...
Best,
~ Ender Nafi
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
Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- Posts: 4
- Joined: Mon Feb 18, 2013 4:01 pm
Re: How to get the source code of a page in native browser
got it. thanks so much.
i <3 too livecode
i <3 too livecode
-
- Posts: 4
- Joined: Mon Feb 18, 2013 4:01 pm
Re: How to get the source code of a page in native browser
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 ?
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
Hi Frederic,
Put this into your button's script:
Best,
~ Ender Nafi
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
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
Re: How to get the source code of a page in native browser
This one's better:
Replace myNativeBrowser with the name of your browser control
Best,
~ Ender Nafi
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
Best,
~ Ender Nafi
Last edited by endernafi on Tue Mar 19, 2013 7:00 pm, edited 1 time in total.
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- VIP Livecode Opensource Backer
- Posts: 10
- Joined: Mon Jan 14, 2013 11:11 am
Re: How to get the source code of a page in native browser
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
something like " put iphonecontrolGet(sbrowserid, "text") into fld myTextField " maybe
Re: How to get the source code of a page in native browser
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
{ 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
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- VIP Livecode Opensource Backer
- Posts: 10
- Joined: Mon Jan 14, 2013 11:11 am
Re: How to get the source code of a page in native browser
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 ?
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
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
Could you post the link whose content you're trying to retrieve?
I could give a try, then.
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- VIP Livecode Opensource Backer
- Posts: 10
- Joined: Mon Jan 14, 2013 11:11 am
Re: How to get the source code of a page in native browser
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
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
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
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
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8