How to Copy Brand Name From Amazon Website.

sagar kathiriya

New Member
Joined
Dec 6, 2018
Messages
14
I'm a seller on Amazon. I get a list of top selling products weekly (webpage link). I want to get brand name of that product from amazon. Currently I Have to Do it Manually For Each and Every Product. Screenshot is attachment for reference purpose.

Sample Link : Ikea Adde Chair White Indoor/Outdoor Back Rest: Amazon.in: Home & Kitchen if you check this link then Brand Name is "Ikea". Just like that I want Brand Name For all my Link.

Can Anyone Help with That VBA & Macro Please.
 

Attachments

  • Untitled.png
    Untitled.png
    163.9 KB · Views: 41

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
New version:

VBA Code:
Sub IE_event()
Dim iea As InternetExplorer, doc, search, i%, v
Set iea = CreateObject("InternetExplorer.Application")
iea.Visible = True
For i = 2 To Range("f" & Rows.Count).End(xlUp).row
    iea.navigate Cells(i, 6)
    Do Until Not iea.Busy
        DoEvents
    Loop
    Application.Wait Now + TimeValue("0:00:03")
    Set doc = iea.Document
    Set search = doc.getElementById("bylineInfo")
    On Error Resume Next
    v = search.innerText
    If Err.Number = 0 Then
        Cells(i, 7) = search.innerText
        Cells(i, 8) = search.href
    Else
        Cells(i, 7) = "Error #" & Err.Number
    End If
Next
End Sub
Hi, this code is working perfectly except in some cases when the product is live but the brand name is not available can you help me to distinguish between brand name is not available and the product is not available because I'm getting the same error all time.
For Example.. "www.amazon.in/dp/B07DKBXHPB" in this link product info is available but the brand is not available. So, can you make a different errors in this kind of case to identify them specially?
 

Attachments

  • 2.png
    2.png
    225.1 KB · Views: 9
Upvote 0
New version:

VBA Code:
Sub IE_event()
Dim iea As InternetExplorer, doc, search, i%, v, un, itm
Set iea = CreateObject("InternetExplorer.Application")
iea.Visible = True
For i = 2 To Range("f" & Rows.Count).End(xlUp).row
    iea.navigate Cells(i, 6)
    Do Until Not iea.Busy
        DoEvents
    Loop
    Application.Wait Now + TimeValue("0:00:03")
    Set doc = iea.Document
    Set search = doc.getElementById("bylineInfo")
    On Error Resume Next
    v = search.innerText
    If Err.Number = 0 Then
        Cells(i, 7) = search.innerText
        Cells(i, 8) = search.href
    Else
        Cells(i, 7) = "Error #" & Err.Number
    End If
    Set un = doc.getElementsByClassName("a-size-medium a-color-price")
    If un.Length > 0 Then
        For Each itm In un
            If itm.innerText Like "*unavailable*" Then
                Cells(i, 8) = "Unavailable"
                Cells(i, 7) = doc.getElementById("productTitle").innerText
            End If
        Next
    End If
Next
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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