tahirsatti
New Member
- Joined
- Jan 15, 2012
- Messages
- 6
I am trying to write something in VBA to get all Seller info and Price from Amazon Seller Page, My code is given below.
But after execution,it display error on this line... Range("A4").Value = sellers
My requirment is to display information in this style.
[TABLE="width: 128"]
<tbody>[TR]
[TD]Seller[/TD]
[TD] Price[/TD]
[/TR]
[TR]
[TD]Amazon[/TD]
[TD="align: right"]399.99
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks.
Code:
Sub RunNewModule()
Dim ie As SHDocVw.InternetExplorer
Set ie = New SHDocVw.InternetExplorer
Dim html As MSHTML.HTMLDocument
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False
ie.Navigate "[URL="http://www.amazon.com/gp/offer-listing/B00NNZZG1W/ref=olp_f_new?ie=UTF8&f_new=true&f_primeEligible=true"]http://www.amazon.com/gp/<wbr>offer-listing/B00NNZZG1W/ref=<wbr>olp_f_new?ie=UTF8&f_new=true&<wbr>f_primeEligible=true[/URL]"
Do Until ie.Busy = False
DoEvents
Loop
Set html = ie.document
Set priceData = html.getElementsByClassName("olpOfferPrice")
Set ie = Nothing
Dim sellers
cntr = 4
For Each Item In priceData
Range("B" & cntr) = Item.innerText
cntr = cntr + 1
Next Item
sellers = priceData
Cells.Clear
Range("A3").Value = "Seller"
Range("B3").Value = "Price"
Range("A4").Value = sellers
ie.Quit
End Sub
But after execution,it display error on this line... Range("A4").Value = sellers
My requirment is to display information in this style.
[TABLE="width: 128"]
<tbody>[TR]
[TD]Seller[/TD]
[TD] Price[/TD]
[/TR]
[TR]
[TD]Amazon[/TD]
[TD="align: right"]399.99
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks.