0

I am building a search app that queries a couple of big companies including Walmart. As it happens, sending a GET request to "http://www.walmart.ca/search/lego%20avengers" does not work because there is A LOT (and I mean a lot) of JavaScript at work on the client-side. I did some debugging in Chrome, but I just can't find a server response that contains the search result data. It obviously is not materializing by itself so there has to be an AJAX call that is fetching the data in some format.

If anyone can solve this mystery - find the request that returns the data - I will bow down to your superior developer skills! :-)

Good Lux
  • 896
  • 9
  • 19
Rob Gravelle
  • 325
  • 5
  • 23
  • 1
    Why not just use [their API?](https://developer.walmartlabs.com/docs/read/Search_API) – Mike Cluck Aug 25 '16 at 20:17
  • I 2nd the use of their API, but as a side note, it's not loading the product items via AJAX. You can see this by doing View Source on the page. All that content is _pre_ JS. – noahnu Aug 25 '16 at 20:19
  • Most of the info you want, are inside `shelf-page` divs... you can get the HTML content of it.... – Bonatti Aug 25 '16 at 20:21

1 Answers1

2

I would recommend making a call directly to their API.

https://developer.walmartlabs.com/docs

It provides items, price, and availability in real time. Much easier than trying to filter through the GET request you receive from entering a search.