- Home /
Unity grabbing HTML instead of .txt with WWW
I'm trying to make unity grab the text from this google docs page: https://docs.google.com/document/d/1qQ3rBaW3z9lPBtDmVRkFc0qcZHPkgyWsvcp0nWVhtps/pub
and post it onto a text. I'm currently logging the string until it works. Unfortunately when I debug.log the string, it comes up as HTML....
Here's the script I'm using:
public class LOAD : MonoBehaviour {
public string url = "https://twotouchstudios.com/test/";
public string News1;
void Start () {
StartCoroutine(LoadText());
}
// Update is called once per frame
IEnumerator LoadText()
{
WWW Grabber = new WWW(url);
yield return guiwww;
News1 = Grebber.text;
}
public void OnClickTest()
{
Debug.Log(News1);
}
}
Answer by Naphier · Oct 21, 2016 at 02:20 AM
Well, it's not a txt file, it's a website, so it will get the raw html that is displayed with the page. If you want to get a txt file then I'd suggest using DropBox and downloading the file from a public URL. Or if you have your own server, then put it there.
I've never tried this, but this URL scheme may work for Google Docs https://productforums.google.com/forum/#!topic/docs/SxTRSt2I9NQ
Once I try to use Dropbox, the log comes up blank. The .txt link is correct and it has a full paragraph written...
You have your own server? "https://twotouchstudios.com/test/"?? Just put it there. DropBox I think you need dl=1 variable on the URL. The only time it would come up completely blank is if you didn't reach any website at all.
Your answer
![](https://koobas.hobune.stream/wayback/20220612095055im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Run website's scripts. 0 Answers
Sending variables to HTML 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers