It was an unknown error of my own creation.. its working now.
WWW.string doesnt return the page html as expected
I'm attempting the building of a stack based html parser..
#pragma strict
public var url: String = "http://www.yahoo.com";
var www: WWW;
var a=0;
function Start() {
www = new WWW(url);
}
function Update(){
if (www.isDone==true&& a==0){
var readout:String=www.text;
Debug.Log("www content= "+readout.Concat);
a=1;
}
}
However my Debug log just puts out Debug. www content= CompilerGenerated.DrgCryptoParser_Update$callable0$17_31 UnityEngine.MonoBehaviour:print(Object) DrgCryptoParser:Update() (at Assets/DrgCryptoParser.js:17) not the page content as I had hoped. How do I get all the HTML text returned?
ok, im not sure what i did, but its working now using this code.. sorry 'Im trying to use the code snippet box.. but I'm in China and maybe the function is getting filtered out. but the problem is solved.
public var url: String; var www: WWW; var a=0; function Start() { www = new WWW( "http//:www.yahoo.com"); %|133417295_1|% } function Update(){ if (www.isDone==true&& a==0){ var readout=www.text ; print("www content= "+readout); //var renderer: Renderer = GetComponent.<Renderer>(); //renderer.material.mainTexture = www.texture; a=1; } }
Follow this Question
Related Questions
scraping from a web page with minimal use? 0 Answers
run scipt on html webpage 1 Answer
WWW Text Returning Anti-Robot HTML String 0 Answers
How to load HTML page inside unity game? 1 Answer
\n Not picked up when reading string from file's name 1 Answer