Tuesday, March 16, 2010

<%
subcategoryId = Request.QueryString("subid")
subsubcategoryid =Request.QueryString("subsubcategoryid")

strURL = "http://www.find-services.co.uk/electric/elecsearch.aspx?site=xpert4u&maincategory=" + subcategoryId + "&keywords=" + "&pricefrom=&priceto=&removedups=0&sort=&page=1&pagesize=10000&category="&subsubcategoryid
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", strURL, False
xml.Send
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
Set objLst = Server.CreateObject("Microsoft.XMLDOM")
Set objHdl = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False

If xml.readyState = 4 Then
objXML.LoadXML(xml.responseText)
If objXML.parseError.errorCode <> 0 Then
End If
Set objLst = objXML.getElementsByTagName("item")
noOfHeadlines = objLst.length
cnt = 1
num = 4
%>








<%

For i = 0 To noOfHeadlines - 1

Set objHdl = objLst.item(i)
if Not objHdl.getElementsByTagName("urlMake") Is Nothing Then
imagemake=objHdl.getElementsByTagName("urlMake").item(0).text
End If
if Not objHdl.getElementsByTagName("urlModel") Is Nothing Then
imagemodel=objHdl.getElementsByTagName("urlModel").item(0).text
End If
if Not objHdl.getElementsByTagName("productName") Is Nothing Then
imageName=objHdl.getElementsByTagName("productName").item(0).text
imageName = replace(imageName," ","-")
End If
if Not objHdl.getElementsByTagName("price") Is Nothing Then
imageprice=objHdl.getElementsByTagName("price").item(0).text
End If
if Not objHdl.getElementsByTagName("description") Is Nothing Then
productDescription=objHdl.getElementsByTagName("description").item(0).text
End If
if Not objHdl.getElementsByTagName("productName") Is Nothing Then
ProductName=objHdl.getElementsByTagName("productName").item(0).text
End If
%>








<%
Next
%>

 SN  Make  Model  ProductName  Description
<%=i%> <%=imagemake%> <%=imagemodel%> <%=productName%> <%=productDescription%>

<%
End If
%>

No comments:

Post a Comment