VBA code for Seller offer data

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.
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.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top