PDA

View Full Version : Navigate Through Web links and get data



maruthi
02-10-2012, 06:22 PM
HI guys,

I am looking for a code such that

1) i have a excel consists of part numbers. i have to search those numbers which is in cell "E2" column in Electronics, Cars, Fashion, Collectibles, Coupons and More Online Shopping | eBay (http://www.ebay.com/)
2) when results has displayed i have to go to each link in that page (and results may be in multipages).
3) When first link in the result page is opened that page has to be downloaded to active workbook in separate sheet after that i will fetch some results to another page. then the downloaded sheet has to be deleted. when it done it has to go for second link and i extract some values to another page and then it has to deleted. It has to be repeated up to the last result which can be on page 2 or 3 or may be more.

I have got some code to open page, the search term is entered and results will be displayed. below is the code
Public Sub a12()

'Decleartions
Dim sngStartTime As Single
Dim sngTotalTime As Single
sngStartTime = Timer
Dim Wb As Workbook
Dim rname As String
Dim WkbkName As Object
Dim MyPos
Dim MyPost As String
Dim MyUrl As String
Dim PostUser As String
Dim PostPassword As String
Dim wbkTemp As Workbook
Dim strPrice As String
Dim strShipChar As String
Dim IEwindow As SHDocVw.InternetExplorer
Dim allExplorerWindows As New SHDocVw.ShellWindows
Dim rngPaste As Range
Dim rngPrice As Range
Dim rngShipping As Range
Dim rngBML As Range
Dim price As String
Dim Shipping As String
Dim Delivery As String
Dim store As String
Dim member As String
Dim percentage As String
Dim Ebay_Quickshop As Workbook
Dim SelectObj As Object
Dim ieForm As Object
Dim Lbox As ListBox
Dim Options As Object

'OPening new WebBrowser page

Set IEwindow = CreateObject("InternetExplorer.Application")
IEwindow.Visible = True
IEwindow.Navigate URL:="www.ebay.com"

While IEwindow.Busy
DoEvents
Wend
While IEwindow.ReadyState <> READYSTATE_COMPLETE
DoEvents
Wend

rname = ActiveCell.Value

'Entering value to textbox and clicking

IEwindow.Document.all("_nkw").Value = rname
IEwindow.Document.all("ghSearch").Click

While IEwindow.Busy
DoEvents
Wend
While IEwindow.ReadyState <> READYSTATE_COMPLETE
DoEvents
Wend



End Sub


please help me to code it further.

Thanks in advance
Maruthi kumar