put URL missing data?

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Cyclonex
Posts: 14
Joined: Mon Oct 27, 2014 6:56 pm

put URL missing data?

Post by Cyclonex » Sun Aug 16, 2015 1:24 am

Hi, I tried getting the html data from Google's homepage using both Livecode and Applescript, however when I ran the programs, Livecode only gave me data that contained 443 words whereas Applescript had 4000.

Livecode Code:
put URL "https(colon)//www(dot)google(dot)com"

Applescript Code:
// open google homepage in safari
tell application "Safari" to set theURLtext to source of document 1
display dialog theURLtext

I'm wondering if Livecode has an equivalent process to what I was doing in Applescript? Thanks

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: put URL missing data?

Post by FourthWorld » Sun Aug 16, 2015 2:55 am

It may be the difference between the raw text and the rendered text. Have you looked at the JavaScript for that page?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Cyclonex
Posts: 14
Joined: Mon Oct 27, 2014 6:56 pm

Re: put URL missing data?

Post by Cyclonex » Sun Aug 16, 2015 4:12 am

Is there a way to access a website's javascript data using livecode? I couldn't find anything posted about that.

Also I tried attaching a text file / livecode stack so people could view the results but it seems that those filetypes are restricted... what filetypes can we post?

Thanks.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: put URL missing data?

Post by Simon » Sun Aug 16, 2015 4:55 am

Hi Cyclonex,
You need 10 posts before you can upload (spammers) but then just zip the files up.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Cyclonex
Posts: 14
Joined: Mon Oct 27, 2014 6:56 pm

Re: put URL missing data?

Post by Cyclonex » Sun Aug 16, 2015 3:39 pm

Makes sense haha, thanks

My question now is if there are other ways to get more information from a webpage in livecode besides using URL?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: put URL missing data?

Post by FourthWorld » Sun Aug 16, 2015 4:09 pm

What information are you looking for?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Cyclonex
Posts: 14
Joined: Mon Oct 27, 2014 6:56 pm

Re: put URL missing data?

Post by Cyclonex » Sun Aug 16, 2015 4:32 pm

Well, I guess a better way to frame the question is if someone knows what the difference between getting Livecode's "URL" versus Applescript's "source" of a webpage is, as I am unsure.

Cyclonex
Posts: 14
Joined: Mon Oct 27, 2014 6:56 pm

Re: put URL missing data?

Post by Cyclonex » Sun Aug 16, 2015 9:20 pm

I'm not super familiar with the different types of data one can access from a webpage.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: put URL missing data?

Post by MaxV » Tue Aug 18, 2015 9:06 am

This code:

Code: Select all

put URL "http://www.google.com"
returns this:

Code: Select all

<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="it"><head><meta content="/images/google_favicon_128.png" itemprop="image"><title>Google</title><script>(function(){window.google={kEI:'MOfSVfnkN6adygPuzLmwBQ',kEXPI:'3700253,3700372,4029815,4031109,4032235,4032500,4032677,4033307,4033344,4034882,4036195,4036527,4036669,4036848,4037333,4037457,4037569,4037933,4038012,4039462,4040112,4040136,4040360,4040849,4040865,4041440,4041837,4041898,4041974,4042052,4042180,4042383,4042695,4042832,4043120,4043255,4043411,4043457,4043459,4043468,4043563,4043615,4043804,4044307,4044309,4044346,8300200,8300203,8500394,8500572,8501295,8501406,8501489,8501988,10200083,10201373',authuser:0,kscs:'c9c918f0_10'};google.kHL='it';})();(function(){google.lc=[];google.li=0;google.getEI=function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI};google.getLEI=function(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid")));)a=a.parentNode;return b};google.https=function(){return"https:"==window.location.protocol};google.ml=function(){return null};google.time=function(){return(new Date).getTime()};google.log=function(a,b,d,e,g){a=google.logUrl(a,b,d,e,g);if(""!=a){b=new Image;var c=google.lc,f=google.li;c[f]=b;b.onerror=b.onload=b.onabort=function(){delete c[f]};window.google&&window.google.vel&&window.google.vel.lu&&window.google.vel.lu(a);b.src=a;google.li=f+1}};google.logUrl=function(a,b,d,e,g){var c="",f=google.ls||"";if(!d&&-1==b.search("&ei=")){var h=google.getEI(e),c="&ei="+h;-1==b.search("&lei=")&&((e=google.getLEI(e))?c+="&lei="+e:h!=google.kEI&&(c+="&lei="+google.kEI))}a=d||"/"+(g||"gen_204")+"?atyp=i&ct="+a+"&cad="+b+c+f+"&zx="+google.time();/^http:/i.test(a)&&google.https()&&(google.ml(Error("a"),!1,{src:a,glmm:1}),a="");return a};google.y={};google.x=function(a,b){google.y[a.id]=[a,b];return!1};google.load=function(a,b,d){google.x({id:a+k++},function(){google.load(a,b,d)})};var k=0;})();google.kCSI={};var _gjwl=location;function _gjuc(){var a=_gjwl.href.indexOf("#");if(0<=a&&(a=_gjwl.href.substring(a),0<a.indexOf("&q=")||0<=a.indexOf("#q="))&&(a=a.substring(1),-1==a.indexOf("#"))){for(var d=0;d<a.length;){var b=d;"&"==a.charAt(b)&&++b;var c=a.indexOf("&",b);-1==c&&(c=a.length);b=a.substring(b,c);if(0==b.indexOf("fp="))a=a.substring(0,d)+a.substring(c,a.length),c=d;else if("cad=h"==b)return 0;d=c}_gjwl.href="/search?"+a+"&cad=h";return 1}return 0}
function _gjh(){!_gjuc()&&window.google&&google.x&&google.x({id:"GJH"},function(){google.nav&&google.nav.gjh&&google.nav.gjh()})};window._gjh&&_gjh();</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}
</style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.h{color:#36c}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px}.gsfi,.lst{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds{display:inline-box;display:inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}a.gb1,a.gb2,a.gb3,a.gb4{color:#11c !important}body{background:#fff;color:black}a{color:#11c;text-decoration:none}a:hover,a:active{text-decoration:underline}.fl a{color:#36c}a:visited{color:#551a8b}a.gb1,a.gb4{text-decoration:underline}a.gb3:hover{text-decoration:none}#ghead a.gb2:hover{color:#fff !important}.sblc{padding-top:5px}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px}.lsbb{background:#eee;border:solid 1px;border-color:#ccc #999 #999 #ccc;height:30px}.lsbb{display:block}.ftl,#fll a{display:inline-block;margin:0 12px}.lsb{background:url(/images/srpr/nav_logo80.png) 0 -258px repeat-x;border:none;color:#000;cursor:pointer;height:30px;margin:0;outline:0;font:15px arial,sans-serif;vertical-align:top}.lsb:active{background:#ccc}.lst:focus{outline:none}</style><script></script></head><body bgcolor="#fff"><script>(function(){var src='/images/nav_logo199.png';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;}
if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}
}
})();</script><div id="mngb">    <div id=gbar><nobr><b class=gb1>Ricerca</b> <a class=gb1 href="http://www.google.it/imghp?hl=it&tab=wi">Immagini</a> <a class=gb1 href="http://maps.google.it/maps?hl=it&tab=wl">Maps</a> <a class=gb1 href="https://play.google.com/?hl=it&tab=w8">Play</a> <a class=gb1 href="http://www.youtube.com/?gl=IT&tab=w1">YouTube</a> <a class=gb1 href="http://news.google.it/nwshp?hl=it&tab=wn">News</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 href="https://drive.google.com/?tab=wo">Drive</a> <a class=gb1 style="text-decoration:none" href="http://www.google.it/intl/it/options/"><u>Altro</u> &raquo;</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a href="http://www.google.it/history/optout?hl=it" class=gb4>Cronologia web</a> | <a  href="/preferences?hl=it" class=gb4>Impostazioni</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=it&continue=http://www.google.it/%3Fgfe_rd%3Dcr%26ei%3DMOfSVcHQG4LF8AeU052QBA" class=gb4>Accedi</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div>    </div><center><span id="prt" style="display:block"> <div><style>.pmoabs{background-color:#fff;border:1px solid #E5E5E5;color:#666;font-size:13px;padding-bottom:20px;position:absolute;right:2px;top:3px;z-index:986}#pmolnk{border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px}.kd-button-submit{border:1px solid #3079ed;background-color:#4d90fe;background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#4787ed));background-image:-webkit-linear-gradient(top,#4d90fe,#4787ed);background-image:-moz-linear-gradient(top,#4d90fe,#4787ed);background-image:-ms-linear-gradient(top,#4d90fe,#4787ed);background-image:-o-linear-gradient(top,#4d90fe,#4787ed);background-image:linear-gradient(top,#4d90fe,#4787ed);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#4d90fe',EndColorStr='#4787ed')}.kd-button-submit:hover{border:1px solid #2f5bb7;background-color:#357ae8;background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#357ae8));background-image:-webkit-linear-gradient(top,#4d90fe,#357ae8);background-image:-moz-linear-gradient(top,#4d90fe,#357ae8);background-image:-ms-linear-gradient(top,#4d90fe,#357ae8);background-image:-o-linear-gradient(top,#4d90fe,#357ae8);background-image:linear-gradient(top,#4d90fe,#357ae8);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#4d90fe',EndColorStr='#357ae8')}.kd-button-submit:active{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.3);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.3);box-shadow:inset 0 1px 2px rgba(0,0,0,0.3)}#pmolnk a{color:#fff;display:inline-block;font-weight:bold;padding:5px 20px;text-decoration:none;white-space:nowrap}.xbtn{color:#999;cursor:pointer;font-size:23px;line-height:5px;padding-top:5px}.padi{padding:0 8px 0 10px}.padt{padding:5px 20px 0 0;color:#444}.pads{text-align:left;max-width:200px}</style> <div class="pmoabs" id="pmocntr2" style="behavior:url(#default#userdata);display:none"> <table border="0"> <tr> <td colspan="2"> <div class="xbtn" onclick="google.promos&&google.promos.toast&& google.promos.toast.cpc()" style="float:right">&times;</div> </td> </tr> <tr> <td class="padi" rowspan="2"> <img src="/images/icons/product/chrome-48.png"> </td> <td class="pads">Un modo migliore per navigare sul Web</td> </tr> <tr> <td class="padt"> <div class="kd-button-submit" id="pmolnk"> <a href="/chrome/browser/?hl=it&brand=CHNG&utm_source=it-hpp&utm_medium=hpp&utm_campaign=it" onclick="google.promos&&google.promos.toast&& google.promos.toast.cl()">Scarica Google Chrome</a> </div> </td> </tr> </table> </div> <script type="text/javascript">(function(){var a={v:{}};a.v.Ha=50;a.v.Fa=10;a.v.ma="body";a.v.gb=!0;a.v.jb=function(b,c){var d=a.v.Ta();a.v.Va(d,b,c);a.v.kb(d);a.v.gb&&a.v.hb(d)};a.v.kb=function(b){(b=a.v.oa(b))&&0<b.forms.length&&b.forms[0].submit()};a.v.Ta=function(){var b=document.createElement("iframe");b.height=0;b.width=0;b.style.overflow="hidden";b.style.top=b.style.left="-100px";b.style.position="absolute";document.body.appendChild(b);return b};a.v.oa=function(b){return b.contentDocument||b.contentWindow.document};a.v.Va=function(b,c,d){b=a.v.oa(b);b.open();d=["<",a.v.ma,'><form method=POST action="',d,'">'];for(var e in c)c.hasOwnProperty(e)&&d.push('<textarea name="',e,'">',c[e],"</textarea>");d.push("</form></",a.v.ma,">");b.write(d.join(""));b.close()};a.v.qa=function(b,c){c>a.v.Fa?google&&google.ml&&google.ml(Error("ogcdr"),!1,{cause:"timeout"}):b.contentWindow?a.v.ib(b):window.setTimeout(function(){a.v.qa(b,c+1)},a.v.Ha)};a.v.ib=function(b){document.body.removeChild(b)};a.v.hb=function(b){a.v.Ra(b,"load",function(){a.v.qa(b,0)})};a.v.Ra=function(b,c,d){b.addEventListener?b.addEventListener(c,d,!1):b.attachEvent&&b.attachEvent("on"+c,d)};var m={nb:0,M:1,N:2,T:5};a.s={};a.s.V={Ba:"i",S:"d",Da:"l"};a.s.J={W:"0",O:"1"};a.s.X={U:1,S:2,R:3};a.s.H={va:"a",za:"g",L:"c",Na:"u",Ma:"t",W:"p",Ga:"pid",xa:"eid",Oa:"at"};a.s.Ca=window.location.protocol+"//www.google.com/_/og/promos/";a.s.ya="g";a.s.Pa="z";a.s.ga=function(b,c,d,e){var f=null;switch(c){case m.M:f=window.gbar.up.gpd(b,d,!0);break;case m.T:f=window.gbar.up.gcc(e)}return null==f?0:parseInt(f,10)};a.s.Za=function(b,c,d){return c==m.M?null!=window.gbar.up.gpd(b,d,!0):!1};a.s.Y=function(b,c,d,e,f,h,k,l){var g={};g[a.s.H.W]=b;g[a.s.H.za]=c;g[a.s.H.va]=d;g[a.s.H.Oa]=e;g[a.s.H.xa]=f;g[a.s.H.Ga]=1;k&&(g[a.s.H.L]=k);l&&(g[a.s.H.Na]=l);if(h)g[a.s.H.Ma]=h;else return google.ml(Error("knu"),!1,{cause:"Token is not found"}),null;return g};a.s.ja=function(b,c,d){if(b){var e=c?a.s.ya:a.s.Pa;c&&d&&(e+="?authuser="+d);a.v.jb(b,a.s.Ca+e)}};a.s.Ua=function(b,c,d,e,f,h,k){b=a.s.Y(c,b,a.s.V.S,a.s.X.S,d,f,null,e);a.s.ja(b,h,k)};a.s.Xa=function(b,c,d,e,f,h,k){b=a.s.Y(c,b,a.s.V.Ba,a.s.X.U,d,f,e,null);a.s.ja(b,h,k)};a.s.bb=function(b,c,d,e,f,h,k,l,g,n){switch(c){case m.T:window.gbar.up.dpc(e,f);break;case m.M:window.gbar.up.spd(b,d,1,!0);break;case m.N:g=g||!1,l=l||"",h=h||0,k=k||a.s.J.O,n=n||0,a.s.Ua(e,h,k,f,l,g,n)}};a.s.$a=function(b,c,d,e,f){return c==m.M?0<d&&a.s.ga(b,c,e,f)>=d:!1};a.s.Wa=function(b,c,d,e,f,h,k,l,g,n){switch(c){case m.T:window.gbar.up.iic(e,f);break;case m.M:c=a.s.ga(b,c,d,e)+1;window.gbar.up.spd(b,d,c.toString(),!0);break;case m.N:g=g||!1,l=l||"",h=h||0,k=k||a.s.J.W,n=n||0,a.s.Xa(e,h,k,1,l,g,n)}};a.s.ab=function(b,c,d,e,f,h){b=a.s.Y(c,b,a.s.V.Da,a.s.X.R,d,e,null,null);a.s.ja(b,f,h)};var p={lb:"a",ob:"l",mb:"c",wa:"d",R:"h",U:"i",zb:"n",O:"x",wb:"ma",xb:"mc",yb:"mi",pb:"pa",qb:"pc",tb:"pi",vb:"pn",ub:"px",rb:"pd",Ab:"gpa",Cb:"gpi",Db:"gpn",Eb:"gpx",Bb:"gpd"};a.o={};a.o.G={Ea:"hplogo",La:"pmocntr2"};a.o.J={Ka:"0",O:"1",ta:"2"};a.o.w=document.getElementById(a.o.G.La);a.o.Aa=16;a.o.Ia=2;a.o.Ja=20;google.promos=google.promos||{};google.promos.toast=google.promos.toast||{};a.o.P=function(b){a.o.w&&(a.o.w.style.display=b?"":"none",a.o.w.parentNode&&(a.o.w.parentNode.style.position=b?"relative":""))};a.o.ra=function(b){try{if(a.o.w&&b&&b.es&&b.es.m){var c=window.gbar.rtl(document.body)?"left":"right";a.o.w.style[c]=b.es.m-a.o.Aa+a.o.Ia+"px";a.o.w.style.top=a.o.Ja+"px"}}catch(d){google.ml(d,!1,{cause:a.o.I+"_PT"})}};google.promos.toast.cl=function(){try{a.o.Z==m.N&&a.s.ab(a.o.ha,a.o.K,a.o.J.ta,a.o.la,a.o.ia,a.o.ka),window.gbar.up.sl(a.o.K,a.o.I,p.R,a.o.$(),1)}catch(b){google.ml(b,!1,{cause:a.o.I+"_CL"})}};google.promos.toast.cpc=function(){try{a.o.w&&(a.o.P(!1),a.s.bb(a.o.w,a.o.Z,a.o.G.na,a.o.ha,a.o.Sa,a.o.K,a.o.J.O,a.o.la,a.o.ia,a.o.ka),window.gbar.up.sl(a.o.K,a.o.I,p.wa,a.o.$(),1))}catch(b){google.ml(b,!1,{cause:a.o.I+"_CPC"})}};a.o.pa=function(){try{if(a.o.w){var b=276,c=document.getElementById(a.o.G.Ea);c&&(b=Math.max(b,c.offsetWidth));var d=parseInt(a.o.w.style.right,10)||0;a.o.w.style.visibility=2*(a.o.w.offsetWidth+d)+b>document.body.clientWidth?"hidden":""}}catch(e){google.ml(e,!1,{cause:a.o.I+"_HOSW"})}};a.o.Qa=function(){var b=["gpd","spd","aeh","sl"];if(!window.gbar||!window.gbar.up)return!1;for(var c=0,d;d=b[c];c++)if(!(d in window.gbar.up))return!1;return!0};a.o.Ya=function(){return a.o.w.currentStyle&&"absolute"!=a.o.w.currentStyle.position};google.promos.toast.init=function(b,c,d,e,f,h,k,l,g,n,q,r){try{if(!a.o.Qa())google.ml(Error("apa"),!1,{cause:a.o.I+"_INIT"});else if(a.o.w)if(e==m.N&&!l==!g)google.ml(Error("tku"),!1,{cause:"zwieback: "+g+", gaia: "+l}),a.o.P(!1);else if(a.o.G.L="toast_count_"+c+(q?"_"+q:""),a.o.G.na="toast_dp_"+c+(r?"_"+r:""),a.o.I=d,a.o.K=b,a.o.Z=e,a.o.ha=c,a.o.Sa=f,a.o.la=l?l:g,a.o.ia=!!l,a.o.ka=k,a.s.Za(a.o.w,e,a.o.G.na,c)||a.s.$a(a.o.w,e,h,a.o.G.L,c)||a.o.Ya())a.o.P(!1);else{a.s.Wa(a.o.w,e,a.o.G.L,c,f,a.o.K,a.o.J.Ka,a.o.la,a.o.ia,a.o.ka);if(!n){try{window.gbar.up.aeh(window,"resize",a.o.pa)}catch(u){}window.lol=a.o.pa;window.gbar.elr&&a.o.ra(window.gbar.elr());window.gbar.elc&&window.gbar.elc(a.o.ra);a.o.P(!0)}window.gbar.up.sl(a.o.K,a.o.I,p.U,a.o.$())}}catch(t){google.ml(t,!1,{cause:a.o.I+"_INIT"})}};a.o.$=function(){var b=a.s.ga(a.o.w,a.o.Z,a.o.G.L,a.o.ha);return"ic="+b};})();</script> <script type="text/javascript">(function(){var sourceWebappPromoID=156001;var sourceWebappGroupID=5;var payloadType=5;var cookieMaxAgeSec=2592000;var dismissalType=5;var impressionCap=25;var gaiaXsrfToken='';var zwbkXsrfToken='';var kansasDismissalEnabled=false;var sessionIndex=0;var invisible=false;window.gbar&&gbar.up&&gbar.up.r&&gbar.up.r(payloadType,function(show){if (show){google.promos.toast.init(sourceWebappPromoID,sourceWebappGroupID,payloadType,dismissalType,cookieMaxAgeSec,impressionCap,sessionIndex,gaiaXsrfToken,zwbkXsrfToken,invisible,'0612');}
});})();</script> </div> </span><br clear="all" id="lgpd"><div id="lga"><div style="padding:28px 0 3px"><div style="height:110px;width:276px;background:url(/images/srpr/logo9w.png) no-repeat" title="Google" align="left" id="hplogo" onload="window.lol&&lol()"><div style="color:#777;font-size:16px;font-weight:bold;position:relative;top:70px;left:218px" nowrap="">Italia</div></div></div><br></div><form action="/search" name="f"><table cellpadding="0" cellspacing="0"><tr valign="top"><td width="25%">&nbsp;</td><td align="center" nowrap=""><input name="ie" value="ISO-8859-1" type="hidden"><input value="it" name="hl" type="hidden"><input name="source" type="hidden" value="hp"><input name="biw" type="hidden"><input name="bih" type="hidden"><div class="ds" style="height:32px;margin:4px 0"><input style="color:#000;margin:0;padding:5px 8px 0 6px;vertical-align:top" autocomplete="off" class="lst" value="" title="Cerca con Google" maxlength="2048" name="q" size="57"></div><br style="line-height:0"><span class="ds"><span class="lsbb"><input class="lsb" value="Cerca con Google" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" value="Mi sento fortunato" name="btnI" onclick="if(this.form.q.value)this.checked=1; else top.location='/doodles/'" type="submit"></span></span></td><td class="fl sblc" align="left" nowrap="" width="25%"><a href="/advanced_search?hl=it&authuser=0">Ricerca avanzata</a><a href="/language_tools?hl=it&authuser=0">Strumenti per le lingue</a></td></tr></table><input id="gbv" name="gbv" type="hidden" value="1"></form><div id="gac_scont"></div><div style="font-size:83%;min-height:3.5em"><br></div><span id="footer"><div style="font-size:10pt"><div style="margin:19px auto;text-align:center" id="fll"><a href="/intl/it/ads/">Pubblicità</a><a href="http://www.google.it/intl/it/services/">Soluzioni aziendali</a><a href="https://plus.google.com/101652436578946786044" rel="publisher">+Google</a><a href="/intl/it/about.html">Tutto su Google</a><a href="http://www.google.it/setprefdomain?prefdom=US&sig=__uPZdOp8NUxW_ggFb8-ApJ_1gy90%3D" id="fehl">Google.com</a></div></div><p style="color:#767676;font-size:8pt">&copy; 2015 - <a href="/intl/it/policies/privacy/">Privacy</a> - <a href="/intl/it/policies/terms/">Termini</a></p></span></center><script>(function(){window.google.cdo={height:0,width:0};(function(){var a=window.innerWidth,b=window.innerHeight;if(!a||!b)var c=window.document,d="CSS1Compat"==c.compatMode?c.documentElement:c.body,a=d.clientWidth,b=d.clientHeight;a&&b&&(a!=google.cdo.width||b!=google.cdo.height)&&google.log("","","/client_204?&atyp=i&biw="+a+"&bih="+b+"&ei="+google.kEI);})();})();</script><div id="xjsd"></div><div id="xjsi" data-jiis="bp"><script>(function(){function c(b){window.setTimeout(function(){var a=document.createElement("script");a.src=b;document.getElementById("xjsd").appendChild(a)},0)}google.dljp=function(b,a){google.xjsu=b;c(a)};google.dlj=c;})();(function(){window.google.xjsrm=[];})();if(google.y)google.y.first=[];if(!google.xjs){window._=window._||{};window._._DumpException=function(e){throw e};if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=new Date().getTime();}google.dljp('/xjs/_/js/k\x3dxjs.hp.en_US.PcijURl98CQ.O/m\x3dsb_he,d/rt\x3dj/d\x3d1/t\x3dzcms/rs\x3dACT90oGyJwREQncJAmNXRjGDYE_-VMWaOg','/xjs/_/js/k\x3dxjs.hp.en_US.PcijURl98CQ.O/m\x3dsb_he,d/rt\x3dj/d\x3d1/t\x3dzcms/rs\x3dACT90oGyJwREQncJAmNXRjGDYE_-VMWaOg');google.xjs=1;}google.pmc={"sb_he":{"agen":true,"cgen":true,"client":"heirloom-hp","dh":true,"ds":"","fl":true,"host":"google.it","jam":0,"jsonp":true,"lm":true,"msgs":{"cibl":"Cancella ricerca","dym":"Forse cercavi:","lcky":"Mi sento fortunato","lml":"Ulteriori informazioni","oskt":"Strumenti di immissione","psrc":"Questa ricerca è stata rimossa dalla tua \u003Ca href=\"/history\"\u003ECronologia web\u003C/a\u003E","psrl":"Rimuovi","sbit":"Ricerca tramite immagine","srch":"Cerca con Google"},"ovr":{},"pq":"","refoq":true,"refpd":true,"rfs":[],"scd":10,"sce":5,"stok":"6Q2nzXfPGkYoPOiv2vby088V9Zs"},"d":{}};google.y.first.push(function(){if(google.med){google.med('init');google.initHistory();google.med('history');}});if(google.j&&google.j.en&&google.j.xi){window.setTimeout(google.j.xi,0);}
</script></div></body></html>
Where is the problem?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Cyclonex
Posts: 14
Joined: Mon Oct 27, 2014 6:56 pm

Re: put URL missing data?

Post by Cyclonex » Tue Aug 18, 2015 2:13 pm

I attached a stack with the livecode data versus applescript data. In short, the livecode data has much fewer lines than the applescript one and so I'm curious why that is. Thanks :)
Attachments
Data.zip
(60.82 KiB) Downloaded 278 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: put URL missing data?

Post by FourthWorld » Wed Aug 19, 2015 2:07 am

If I read the AppleScript correctly what you're obtaining there is the rendered text, while the LiveCode script is obtaining the source HTML. I haven't sifted through each of the data sets you provided so this is just a hunch, but many times a Web page will include JavaScript directives that import additional data into the page. The browser, such as Safari, will do this automatically, but when obtaining the data from a URL in LiveCode it doesn't also interpret JavaScrirpt, CSS, or any other directives there, so what you'll get is the raw source HTML as posted to the server, with no post-processing.

Which do you want?

Or to ask another way, what are you trying to accomplish?

One quick way to see the differences easily is to write each of the data to a text file ending with ".html", and then open each in a separate browser window and see if you can spot the differences.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Cyclonex
Posts: 14
Joined: Mon Oct 27, 2014 6:56 pm

Re: put URL missing data?

Post by Cyclonex » Thu Aug 20, 2015 1:38 pm

Awesome, that explains why there is a lot more data.

Is it possible to obtain the Javascript data using just Livecode, or would I have to use another program like applescript to obtain it?

Post Reply

Return to “Internet”