+ Reply to Thread
Results 1 to 11 of 11

Scrap data from Amazon using Selenium and VBA

  1. #1
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    774

    Scrap data from Amazon using Selenium and VBA

    Hello everybody,
    Could you help me in my question ,please?
    The code in my file searches amazon site for a product and gets the following data "name-price-link" in order to find the cheapest offer.The code gets data of first search page only.
    Note:in order to make the code work without problems,you should close chrome first.
    The question:
    How to make the code navigate to other pages in Amazon to get data of products from?
    please help me
    Last edited by leprince2007; 04-26-2022 at 02:13 AM.

  2. #2
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    774

    Re: Scrap data from Amazon using Selenium and VBA

    Bump...Bump
    Please help me

  3. #3
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    774

    Re: Scrap data from Amazon using Selenium and VBA

    Bump..Bump
    Is there anything unclear?
    Please help me

  4. #4
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Scrap data from Amazon using Selenium and VBA

    If you search for Apple iPhone 11 you get a whole page of phones.

  5. #5
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    774

    Re: Scrap data from Amazon using Selenium and VBA

    mogul, Thanks for your reply.If you search for Apple iPhone 11, you get multiple pages not one.
    The code get data for the first page only in Amazon site.I want to navigate to other pages(2,3,4,etc....) in order to get data from,how?

  6. #6
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Scrap data from Amazon using Selenium and VBA

    I assume you are talking about the carousel down below.

    Attachment 778325

    In order to get the carousel you'll need to use Xpath to get elements. For example this gets you the elements in the carousel.

    .//ol[contains(@class, 'a-carousel')]

    to get each element you'll need to use

    (.//li[contains(@class, 'a-carousel-card')])[1]

    To get to next page use

    .//span[text()='Next page']

    If I have time I'll try to do a demo.

  7. #7
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    774

    Re: Scrap data from Amazon using Selenium and VBA

    I tried this but didn`t work:
    Please Login or Register  to view this content.
    Please apply your solution on the file and attach it.
    Help me, please.

  8. #8
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Scrap data from Amazon using Selenium and VBA

    Sorry, there are 2 elements in page. Try

    (.//span[text()='Next page'])[1]

    You need to test Xpath on page to make sure it works. I use Try Xpath in Firefox. I'm sure Chrome has some extensions.

  9. #9
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    774

    Re: Scrap data from Amazon using Selenium and VBA

    mogul,I tried your suggestion but didn`t work.
    And I tried the xpath and worked for second page only and for other pages doesnot work,because the xpath for next button change on every page:
    Please Login or Register  to view this content.
    Please apply your solution on the file and attach it because I`am not familiar with selenium .
    Last edited by leprince2007; 04-27-2022 at 04:06 AM.

  10. #10
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Scrap data from Amazon using Selenium and VBA

    It didn't work for me either. Scraping Amazon is difficult. I would try a Selenium forum. I tried to scrape Amazon for upcoming book releases. It is very difficult to do and Amazon constantly changes. I ended up using Barnes and Noble

  11. #11
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    774

    Re: Scrap data from Amazon using Selenium and VBA

    After alot of search and tries,I could solve it
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Selenium Basic - Does anyone know if you can change user-agent in selenium basic?
    By 0o0o0 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2021, 03:18 AM
  2. Scrap data from multiple Links
    By camarao69 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-28-2018, 04:52 AM
  3. Macro that copies a cell into Amazon search and returns Amazon product ASIN
    By kwiddoes23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2017, 06:28 AM
  4. Extraction Amazon Lower FBA Price from Amazon using VBA
    By tahirsatti in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-30-2015, 01:42 PM
  5. [SOLVED] Scrap unwanted data
    By makinmomb in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-06-2014, 11:49 PM
  6. VBA to scrap job board data
    By Sako in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2013, 09:41 PM
  7. i have list of url in my sheet.i want to scrap data from about us page.....
    By Jalpesh Dadania in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2013, 03:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1