Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
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.
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
Have you tried include the site (with the price) within an iframe and then accessing the data with javascript/jquery?
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a function to show current date and time using date() function in php.
I used
meta http-equiv="refresh" content="30" to refresh the whole page.
But i want to refresh only that specific function part as i want to change the time every minute. Is it possible?
In short, no it is not possible with just PHP and HTML.
Once your page has been generated by your PHP script, it is sent to the client and cannot be modified anymore. HTML is made to build "static" web pages, that mean they won't produce fancy moving things and therefore they won't update content once the page is loaded.
But even if you cannot send the page a second time once it has been generated by PHP, you're not bound to HTML in the page. You can set up script in the page that will for example make the client browser perform a request to your server to update part of the page. That's called AJAX, and to do it you have to learn Javascript.
You should use client-side magic for this, so I'd use AJAX techniques.
setInterval(function(){
$("#time").load("page.php #time");
}, 30000);
Justin E asks, you can actually load a specific element from a page. Yes you can.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
http://www.aliexpress.com/item/NEW-7-Android-2-3-256MB-DDR2-4GB-NAND-Flash-7-inch-tablet-pc/498159194.html - I got this link
Here you can see a buttons: bundle, color
If you click some of them the price will change, but the question is how can I parse that behaviour to my page via php?
The problem is that I can't understand where is javascript code that executes this, or how to find it, maybe someone got ideas about that?
Inspecting that page's source code I can see that the skuProducts variable in javascript contains this information encoded into a JSON-string. You can't really run this javascript code on your webserver, so you'll have to devise another way to get that variable's value - and then you can use json_decode() to get the contents.
Note that changing the amount of items results in an AJAX call to a shipping costs calculator. You could probably simulate that, but I'm not sure that webshop would like that (and it might be illegal).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
here is an example, say every item in each list was clicked on http://katproxy.com/the-big-bang-theory-tv8511/, how would you proceed to get the source code of the modified web page using php considering the fact that the url has not changed (file_get_contents is probably out of the question).
Thank you!
Using PHP? You can't, not without fetching the page source and evaluating its JavaScript, which is obviously quite impractical.
The "page" hasn't change, only your in-browser representation of the DOM has been modified. You would need PHP to talk to your browser, and ask for the state of its DOM, not the remote server, which cannot possibly serve up the HTML representation of your browser's current DOM.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
This is probably terribly simple. I have done something similar to this when the information was being passed to a different page.
Basically... I have a div with a dynamically generated list of objects.
<li><?= $array['City'] ?></li>
All of the code already exists to load the zip codes for a given city, so in PHP (in this case)
$locations = new ProjectsLocationsArrays();
$zipcodes = $locations->array_zips($array['City']);
At present, everything runs off of query strings... ?city=aaa&zip=123, seems sloppy to me. I would like to use AJAX. Once the cities are loaded, how do I load the zips into an existing div on the page, fired by a click on one of the city anchors.
TIA
If you have jQuery something like this should work
function loadZipCodes(city){
$.ajax({
url: "pagethatgivesarrayofzipcodes.php",
method: "POST",
data : {'city': city}
}).done(function(data) {
$(.zip-div).html(data);
});
}
Where pagethatgivesarrayofzipcodes.php takes a $_POST['city'] containing the city info and returns either HTML or a a Javascript array of ZIP codes.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm having a lot of trouble working through the API for Blackbird Pie, especially since their API isn't actually an API but is apparently just a blog.
Here's the API link from Blackbird Pie.
I want to be able to take in a unique tweet link that a user enters into my MySQL database and output them to a page using a query and PHP but I'm not really sure how to go about doing this. Searches just reveal methods for embedding tweets manually which is not what I want.
Thanks in advance.
Pindatjuh makes a good point. So if I'm understanding this your basicly building a twitter feed, but you don't want it to display via json or xml from twitter. You could write a little phpscript to scrape the info and before you throw it into the database have them confirm if the information is correct. If I'm understanding you correctly you might want to check out this scraper for IMDB.
http://web3o.blogspot.com/2010/10/php-imdb-scraper-for-new-imdb-template.html
You could probably modify it to your needs.
One more suggestion is the json feed I wrote. Instead of echoing the output you could throw it into the database.
PHP JSON Twitter Feed Improvement
Hope this gives you somewhere to start! Happy Coding.