*-* CmdBrowse.Click
*-* Clear temporay file to allow new itemid
Select idtemp
Zap
Public
noccurrence,ItemID,itemdesc,Ends,starts,pagenum,currentpage,thispage,lchtml,mloc,newpage,thisitemid
*-* Get EBay first page in browser This.Parent.oBrowser.navigate("http://realestate.listings.ebay.com/Land_W0QQfromZR0QQsacategoryZ15841QQsocmdZListingItemListQQsocolumnlayoutZ3")
Do While This.Parent.oBrowser.busy
Wait Window "Please wait...Internet Explorer is busy" + Time()Time 1
Enddo
Do While Lower(This.Parent.oBrowser.Document.readystate)<> "complete"
Wait Window "Please wait... while page downloads "Time 1
Enddo
*-* Get html page and place in variable lchtml
lchtml = This.Parent.oBrowser.Document.body.outerhtml
*-* Determine number of pages to process
mloc = At(">Page",lchtml)
? mloc
Store Substr(lchtml,mloc+15,2) To pagenum
pagenum = Val(pagenum)
*-* Locate Item Id number on page
*-* Called from Function Browser
*-* Set variable for mloc to 1 inorder to find first occurrence
mloc = 1
occurrence = 1
mloc= At("dSI",lchtml,occurrence)
Do While mloc != 0
mloc= At("dSI",lchtml,occurrence)
If mloc != 0
occurrence = occurrence + 1
thisid = Substr(lchtml,mloc+32,10)
If
Substr(thisid,1,1)= ","
thisid = Substr(lchtml,mloc+33,10)
ENDIF
If Substr(thisid,2,1)= ","
thisid = Substr(lchtml,mloc+34,10)
ENDIF
Append Blank
Replace idtemp.ItemID With thisid
Endif
Enddo
*******ITEM NEXT PAGES
thispage = 2
Do While thispage <= pagenum
newpage = Alltrim(Str(thispage)) lchtml=Thisform.wwipstuff.httpget("Http://realestate.listings.ebay.com/Land_W0QQlopgZ"+newpage+"QQlotrZ1QQsacategoryZ15841QQsocmdZListingItemListQQsocolumnlayoutZ3",500000)
*-* Called from Function Browser
*-* Set variable for mloc to 1 inorder to find first occurrence
mloc = 1
occurrence = 1
mloc= At("dSI",lchtml,occurrence)
Do While mloc != 0
mloc= At("dSI",lchtml,occurrence)
If mloc != 0
occurrence =
occurrence + 1
thisid =
Substr(lchtml,mloc+32,10)
If Substr(thisid,1,1)= ","
thisid =
Substr(lchtml,mloc+33,10)
ENDIF
If Substr(thisid,2,1)= ","
thisid = Substr(lchtml,mloc+34,10)
ENDIF
Append Blank
Replace idtemp.ItemID With thisid
Endif
Enddo
thispage = thispage+1
Enddo