4

I guess it is loaded by ajax.

I already tried CURL, DOMDocument and PHP Simple HTML DOM Parser

Details:

I'm trying to get the price of games on Playstation Store. I have an url like https://store.sonyentertainmentnetwork.com/#!/en-us/jogos/shadow-of-the-colossus/cid=UP9000-NPUA80677_00-SOTC000000000001 and I want to get the price. <div class="price">$19.99</div>

I just noticed that if you check the source code of the page, it does not have any element displayed on page, that is because I believe all is loadaded by something like ajax and I guess PHP parses will never work here.

I tried Jquery AJax(), Get() and Load() functions and I did not get success. Some problem with crossdomain.

There is a website called PSN Prices that can do it.

Additional Info:

It is totally for personal purpose, I just want to do some kind of wishlist and follow prices by myself.

Sorry my english.

Leo
  • 580
  • 7
  • 22
  • First I was asking about how to get content from given web page since that page uses ajax and all my methods were not effective. Cornwell gave me the JSON url with the content of the page. It wasn't an asking for code exactly. I have agreed the original question did not fit the answer and I had already edited it and I believe it fits very well now. I don't know what else to do to make it valuable. Sorry my english. – Leo Dec 30 '13 at 02:34
  • And about the content itself, since there is a site as PSN Prices, I think it could be useful if somebody would want to try to develop something similar. – Leo Dec 30 '13 at 02:40

2 Answers2

9

The price is retrieved through JSON: https://store.sonyentertainmentnetwork.com/chihiroview/storetree2?https%3A%2F%2Fstore.sonyentertainmentnetwork.com%2Fstore%2Fapi%2Fchihiro%2F00_09_000%2Fcontainer%2FUS%2Fen%2F999%2FSTORE-MSF77008-BASE%3FsessionCountry%3Dus%26sessionLang%3Den%26geoCountry%3DPT%26size%3D30

search for 19.99

"display_price":"$19.99"

EDIT:

Game url:

https://store.sonyentertainmentnetwork.com/#!/en-us/jogos/shadow-of-the-colossus/cid=UP9000-NPUA80677_00-SOTC000000000001

JSON url:

https://store.sonyentertainmentnetwork.com/store/api/chihiro/00_09_000/container/US/en/999/UP9000-NPUA80677_00-SOTC000000000001

Using http://jsonformatter.curiousconcept.com/ to make it easier, it seems you need to get

default_sku->display_price

Cornwell
  • 3,304
  • 7
  • 51
  • 84
  • Cornwell, thanks for answer! Thats is awesome! I think this is not EXACTLY url for Shadow of colossus. I guess this display price is from another games. But studying the JSON you gave me I found the correct URL for each game. For shadow of colossus, this is the URL: `https://store.sonyentertainmentnetwork.com/store/api/chihiro/00_09_000/container/US/en/999/UP9000-NPUA80677_00-SOTC000000000001`. To get info from another games it is just needed to change the last sequence. If you could edit your answer, I check your answer as accected answer! Thanks a lot! – Leo Dec 27 '13 at 20:10
  • Edited for more clarity – Cornwell Dec 27 '13 at 20:28
  • @Cornwell - Where did you find these API endpoints for the JSON? I'm looking for something like this as well, but also for other endpoints (like lists and search) - but I can't find any documentation what so ever online... – Giovanni Palusa Nov 18 '18 at 20:34
  • @GiovanniPalusa Was wondering the same thing here! Cornwell pls provide link to documentation – sayandcode Jun 19 '22 at 05:52
  • @Cornwell can you please send us the documentation where you found this? Also, the first link you provided is not working anymore, can you please tell us how to go through all the games? Thanks! – Vulovic Vukasin Mar 20 '23 at 00:11
-8

Have you tried include the site (with the price) within an iframe and then accessing the data with javascript/jquery?

Goikiu
  • 574
  • 3
  • 12