Get a numeric value from a website

Hey Guys,
I am trying to get a value from a website.

<span id="insert-graph">3142</span>

The value being 3142.

I have been successful in accessing the website. I have also been successful in grabbing a value using “string search”. The problem i am having at is that the value is static. That indicates to me that the value is not being updated. If anyone has any ideas please let me know. Thank you so much!

void Start () {
		//curDemand = maxDemand;
		InvokeRepeating ("demandCalc", 1f, 1f);


	string url = "";
		WWW www = new WWW(url);
		string input = "<span id=\"insert-graph\">3166</span>";
		string search = "<span id=\"insert-graph\">";
		int p = input.IndexOf (search);
		if (p >= 0) {
			// move forward to the value
			int start = p + search.Length;
		// now find the end by searching for the next closing tag starting at the start position, 
		// limiting the forward search to the max value length
			int end = input.IndexOf ("</span>", start); 
			if (end >= 0) {
				// pull out the substring
				string v = input.Substring (start, end - start);
				// finally parse into a float
				float value = float.Parse (v);
				Debug.Log ("Value = " + value);
				curDemand = value;
			} else {
				//Debug.Log("Bad html - closing tag not found");
		} else {
			Debug.Log ("donations span not found");
	IEnumerator WaitForRequest(WWW www)
		yield return www;
		// check for errors
		if (www.error == null) {
			Debug.Log ("WWW Ok!: " + www.text);
			//site.text = "site" + www.text;

		} else {
			Debug.Log ("WWW Error: " + www.error);

Alright, I’m pretty sure I figured out the reason why we can’t access that number. The script works fine. The problem is with the webpage itself or rather with the way the number is produced. Since the number isn’t static and gets updated, it’s not actually in the html source properties of the webpage. This means that the number is received from a server or similar. Since it’s not in the html source code, we can’t access it because the html source is what we access using the script.

The easiest way is to contact the admin of the page and ask for a way to let you access that number. I assume it would be another html site with just the number in it which actually gets called by the main site.