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.

Seller Price
Amazon399.99

<tbody>
</tbody>


Thanks.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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