 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: retrieving information from an web site</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/retrieving-information-from-an-web-site/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-information-from-an-web-site/</link>
	<description></description>
	<lastBuildDate>Sun, 26 May 2013 01:40:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: palmcmc</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-information-from-an-web-site/#comment-36633</link>
		<dc:creator>palmcmc</dc:creator>
		<pubDate>Fri, 27 Jan 2006 08:21:11 +0000</pubDate>
		<guid isPermaLink="false">#comment-36633</guid>
		<description><![CDATA[Thank you for all of your input I will try your suggestions and see what happens]]></description>
		<content:encoded><![CDATA[<p>Thank you for all of your input I will try your suggestions and see what happens</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wizard90</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-information-from-an-web-site/#comment-36634</link>
		<dc:creator>wizard90</dc:creator>
		<pubDate>Wed, 25 Jan 2006 10:02:46 +0000</pubDate>
		<guid isPermaLink="false">#comment-36634</guid>
		<description><![CDATA[I do this all the time.  The problem with the noaa site is that the temperature is not in a &quot;tag&quot; persay, it is just text on the page.  Not only that, the user can rearrange the page making finding the text within the page difficult.

I use OZEXE (free to try; http://www.ozexe.com )as my tool of choice for this type of work. The following 5 lines of code will get the current temp from accuweather and display it:

DevOpen( IE )
DevWrite(IE,&quot;URL&quot;,&quot;http://wwwa.accuweather.com/index-forecast.asp?partner=accuweather&amp;myadc=0&amp;zipcode=01507&amp;u=1&quot;)
cTemp = DevRead( IE, &quot;text&quot;, &quot;Temperature:&quot;, 10, 1 )
MsgBox( cTemp, &quot;Current Temperature&quot; )
DevClose( IE )

If you were to uncheck the &quot;Display browser on open&quot; checkbox in the device interface setup, you could do this behind the scenes.

The device interface for IE is very useful.  Not only can you get text from a page, but you can read and write elements, hidden or visible, directly as well as run script and perform all navigation functions.  Any time I need to get any data from anything or anywhere, I highly reccomend this tool.]]></description>
		<content:encoded><![CDATA[<p>I do this all the time.  The problem with the noaa site is that the temperature is not in a &#8220;tag&#8221; persay, it is just text on the page.  Not only that, the user can rearrange the page making finding the text within the page difficult.</p>
<p>I use OZEXE (free to try; <a href="http://www.ozexe.com" rel="nofollow">http://www.ozexe.com</a> )as my tool of choice for this type of work. The following 5 lines of code will get the current temp from accuweather and display it:</p>
<p>DevOpen( IE )<br />
DevWrite(IE,&#8221;URL&#8221;,&#8221;http://wwwa.accuweather.com/index-forecast.asp?partner=accuweather&amp;myadc=0&amp;zipcode=01507&amp;u=1&#8243;)<br />
cTemp = DevRead( IE, &#8220;text&#8221;, &#8220;Temperature:&#8221;, 10, 1 )<br />
MsgBox( cTemp, &#8220;Current Temperature&#8221; )<br />
DevClose( IE )</p>
<p>If you were to uncheck the &#8220;Display browser on open&#8221; checkbox in the device interface setup, you could do this behind the scenes.</p>
<p>The device interface for IE is very useful.  Not only can you get text from a page, but you can read and write elements, hidden or visible, directly as well as run script and perform all navigation functions.  Any time I need to get any data from anything or anywhere, I highly reccomend this tool.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stanton</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-information-from-an-web-site/#comment-36635</link>
		<dc:creator>stanton</dc:creator>
		<pubDate>Tue, 24 Jan 2006 13:59:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-36635</guid>
		<description><![CDATA[Here is an example of code.  You will have to put in your own HTML tags as it won&#039;t let me put them in here.

Public Function GetStuff() As Double
    On Error GoTo ErrorHandler
    
    Dim xmlDoc As New DOMDocument
    Dim RequestLevel As IXMLDOMElement
    Dim AddressLevel As IXMLDOMElement
    Dim AddressElementLevel As IXMLDOMElement
    Dim t As Variant
    Dim i As Integer
    Dim hOpen As Long, hConnection As Long, hFile As Long, numread As Long
    Dim sHeader As String, htmlfile As String, tmp As String * 2048
    Dim bDoLoop As Boolean
    Dim WinHttpReq As WinHttp.WinHttpRequest
    Dim MYSERVERNAME As String
    Dim XmlString As String
    Dim strTemp As String
    Dim strResponse As String
    Dim strStatus As String
    Dim intLen As Integer
    
    MYSERVERNAME = &quot;web.site.address.here&quot;
    
    Set WinHttpReq = New WinHttpRequest
&#039;Here our proxy server is defined.    
    WinHttpReq.SetProxy 2, &quot;YOUR.PROXY.SERVER.COM&quot;
    
    XmlString = MYSERVERNAME
    
    WinHttpReq.Open &quot;GET&quot;, XmlString, False
    
    WinHttpReq.Send
    
    strResponse = Mid(WinHttpReq.ResponseText, InStr(WinHttpReq.ResponseText, &quot;sometext&quot;), 300)
    strStatus = WinHttpReq.Status &amp; &quot; - &quot; &amp; WinHttpReq.StatusText
&#039;***** Handle error 
    If InStr(strResponse, &quot;Error&quot;) &gt; 0 Then
        intLen = InStr(strResponse, &quot;endDescriptionTag&quot;) - InStr(strResponse, &quot;DescriptionTag&quot;) - 13
        strTemp = Mid(strResponse, InStr(strResponse, &quot;DescriptionTag&quot;) + 13, intLen)
        MsgBox &quot;There is an error of some type in the Address given.&quot; &amp; vbCrLf &amp; _
            strTemp &amp; vbCrLf &amp; &quot;Please correct and try again!&quot;, vbOKOnly
        Exit Function
    End If
&#039;**** Get specific Item You are looking for based on HTML tags and text within the HTML document
    If InStr(strResponse, &quot;text&quot;) &gt; 0 Then
&#039;**offset is the number of characters after the &quot;text&quot; I want to start at
        strResponse = Mid(strResponse, InStr(strResponse, &quot;text&quot;) + offset, 100)
        strResponse = Mid(strResponse, 1, InStr(strResponse, &quot;endtag&quot;) - 1)
        GetExchangeRate = Val(Trim(strResponse))
    End If
    
    Exit Function
ErrorHandler:
    MsgBox &quot;Error # &quot; &amp; Err.Number &amp; &quot; has occurred!&quot; &amp; vbCr &amp; _
        Err.Description, vbOKOnly + vbExclamation, &quot;ERROR GetStuff&quot;
    Resume Next
End Function


Have fun.
Stanton]]></description>
		<content:encoded><![CDATA[<p>Here is an example of code.  You will have to put in your own HTML tags as it won&#8217;t let me put them in here.</p>
<p>Public Function GetStuff() As Double<br />
    On Error GoTo ErrorHandler</p>
<p>    Dim xmlDoc As New DOMDocument<br />
    Dim RequestLevel As IXMLDOMElement<br />
    Dim AddressLevel As IXMLDOMElement<br />
    Dim AddressElementLevel As IXMLDOMElement<br />
    Dim t As Variant<br />
    Dim i As Integer<br />
    Dim hOpen As Long, hConnection As Long, hFile As Long, numread As Long<br />
    Dim sHeader As String, htmlfile As String, tmp As String * 2048<br />
    Dim bDoLoop As Boolean<br />
    Dim WinHttpReq As WinHttp.WinHttpRequest<br />
    Dim MYSERVERNAME As String<br />
    Dim XmlString As String<br />
    Dim strTemp As String<br />
    Dim strResponse As String<br />
    Dim strStatus As String<br />
    Dim intLen As Integer</p>
<p>    MYSERVERNAME = &#8220;web.site.address.here&#8221;</p>
<p>    Set WinHttpReq = New WinHttpRequest<br />
&#8216;Here our proxy server is defined.<br />
    WinHttpReq.SetProxy 2, &#8220;YOUR.PROXY.SERVER.COM&#8221;</p>
<p>    XmlString = MYSERVERNAME</p>
<p>    WinHttpReq.Open &#8220;GET&#8221;, XmlString, False</p>
<p>    WinHttpReq.Send</p>
<p>    strResponse = Mid(WinHttpReq.ResponseText, InStr(WinHttpReq.ResponseText, &#8220;sometext&#8221;), 300)<br />
    strStatus = WinHttpReq.Status &amp; &#8221; &#8211; &#8221; &amp; WinHttpReq.StatusText<br />
&#8216;***** Handle error<br />
    If InStr(strResponse, &#8220;Error&#8221;) &gt; 0 Then<br />
        intLen = InStr(strResponse, &#8220;endDescriptionTag&#8221;) &#8211; InStr(strResponse, &#8220;DescriptionTag&#8221;) &#8211; 13<br />
        strTemp = Mid(strResponse, InStr(strResponse, &#8220;DescriptionTag&#8221;) + 13, intLen)<br />
        MsgBox &#8220;There is an error of some type in the Address given.&#8221; &amp; vbCrLf &amp; _<br />
            strTemp &amp; vbCrLf &amp; &#8220;Please correct and try again!&#8221;, vbOKOnly<br />
        Exit Function<br />
    End If<br />
&#8216;**** Get specific Item You are looking for based on HTML tags and text within the HTML document<br />
    If InStr(strResponse, &#8220;text&#8221;) &gt; 0 Then<br />
&#8216;**offset is the number of characters after the &#8220;text&#8221; I want to start at<br />
        strResponse = Mid(strResponse, InStr(strResponse, &#8220;text&#8221;) + offset, 100)<br />
        strResponse = Mid(strResponse, 1, InStr(strResponse, &#8220;endtag&#8221;) &#8211; 1)<br />
        GetExchangeRate = Val(Trim(strResponse))<br />
    End If</p>
<p>    Exit Function<br />
ErrorHandler:<br />
    MsgBox &#8220;Error # &#8221; &amp; Err.Number &amp; &#8221; has occurred!&#8221; &amp; vbCr &amp; _<br />
        Err.Description, vbOKOnly + vbExclamation, &#8220;ERROR GetStuff&#8221;<br />
    Resume Next<br />
End Function</p>
<p>Have fun.<br />
Stanton</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.014 seconds using memcached
Object Caching 296/299 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-26 02:55:49 -->