Hello everyone, im having some troubles being able to detect if an item is in stock or out of stock via New-egg.
Currently if you visit a web page from new-egg there is either text saying "In Stock." Or "OUT OF STOCK." Well i want my program to be able to detect this... I have been using this:
Code:
        Dim requests As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(TextBox2.Text)
        Dim response As System.Net.HttpWebResponse = requests.GetResponse()
        Dim sr As System****.StreamReader = New System****.StreamReader(response.GetResponseStream)

        Dim pagestring As String


        pagestring = sr.ReadToEnd
        RichTextBox1.Text = pagestring

        If pagestring.Contains("In stock.") Then
            ListBox1.Items.Add(TextBox2.Text + " - In Sock")
            TextBox2.Clear()
        ElseIf pagestring.Contains("OUT OF STOCK.") Then
            ListBox1.Items.Add(TextBox2.Text + " - Out of Stock")
            TextBox2.Clear()
        Else

            MsgBox("Not a valid newegg page bidding page.")

            Exit Sub
        End If
Now the above text doesent work for 2 reasons. One, is that the normal HTML code has both of those text strings embedded in it if you look... Its for some automated script... So therefore the first if statement always returns true.... Secondly, the actual string that new-egg uses to write if the item is in stock or not is:
Code:
	<p class="note">
	<script type="text/javascript">document.write(Product.stock)</script>
	</p>
Which i found out was actually writing this:
Code:
<em xmlns="http://www.w3.org/1999/xhtml">OUT OF STOCK.</em>
But I can only find that source code when selecting the text -> and clicking view selection source (from firefox)...
Therefore this is some javascript code that is showing up in the browser, but not in the main HTML... I don't have much expeirence with java and why the above code only shows up when viewing selection source shows up is beyond me... Is there a way for me to use VB.net to read the actual document.write(Product.stock) code from javascript? Is that possible to get its result?

Thanks