• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Web Scraping help

Hi All,

I am working on a code to copy product title for all the products appearing on amazon search page and paste it to column A. I have the following code. Need help to click on each product found on the amazon page and copy the product title and paste it in column A:

Images and code below. Appreciate the help !

63846

63848


Code:
Sub Ama_Prod()
    Dim IE As New InternetExplorer, elem As Object
    Dim Html As HTMLDocument, imgs As Object

    With IE
        .Visible = False
        .navigate "https://www.amazon.in/s?k=sarees&ref=nb_sb_noss_2"
        While .Busy Or .readyState < 4: DoEvents: Wend
        Set Html = .document
    End With


   ' 1. click on each product title on page html as follows
     ' <span class="a-size-base-plus a-color-base a-text-normal">women's art silk kalamkari and bhagalpuri style saree with blouse piece and soft feel (kora)</span>


   ' 2. copy the id "product title" from each individual page to column A. HTML for 1st product as follows"

   '  <h1 id="title" class="a-size-large a-spacing-none">            <span id="productTitle" class="a-size-large"> Yashika women 's art silk kalamkari and bhagalpuri style saree with blouse piece and soft feel (kora)</span>
        ' </h1>

  
          

End Sub
 
Last edited:
Hi,​
according to your picture no need to click on any link as all the necessary is yet in the main page …​
 
Maybe first try a request on the webpage - like you used in a previous thread - in order to​
extract from the webpage code all the products URL then you can request each one …​
 
Back
Top