Part of html code im trying to get info from is as follows
<div class="price">15</div>
and part of form is
<select name="group_1" id="group_1" class="attribute_select" onchange="findCombination();getProductAttribute();$('#wrapResetImages').show('slow');;">
<option value="1" selected="selected" title="1">1</option>
<option value="4" title="5">5</option>
</select>
Now when you change select from 1 to 4 price in div changes as the link www.domain.com/product.html/ changes to www.domain.com/product.html#/in-pack-5. The problem is that Conbination of DOMDocument, loadHTML, DOMXPathdoesnt seem to recognize "#/in-pack-5" in the link and keeps scraping default price even when I do force "selected" to value="4".
How can I read second price than? Any ideas please as Im stuck. I would like to apologize if the question been asked already - I was searching for answer for hrs but cant find it anywhere or cant form question properply.
Thanks in advance
edit
Ok it seems the content (second price) is loaded by AJAX and Im told to use link below to reproduce it by php script but have no idea how to achive this
Request URL:https://domain.com//modules/paypal/express_checkout/ajax.php?get_qty=1&id_product=358&id_product_attribute=625&_=1436461450437
Any help would be much appreciated
<?php
$url="https://domain.com//modules/paypal/express_checkout/ajax.php?get_qty=1&id_product=358&id_product_attribute=625&_=1436461450437";
//this line needs PHP 5.4.0+ but poster need something 5.3 compatible. $query=parse_url($url)['query'];
$query=parse_url($url);
$query=$query['query'];//for 5.3- compat.
$data=array();
parse_str($query,$data);
var_dump($data);
edit: wups, original answer was just half of it :p
What Ive figured out is I could loop through option values and change them by echoing javascript code and that works for getting the values and even changing the state of select form. Than I wanted to echo onchange(); but that doesnt work. How can i force onchange() on select form through php by echoing javascript code?
I tried
echo '<script type="text/javascript">
var select = document.getElementById("group_1");
var option = select.getElementsByTagName("option");
for(j=0; j < option.length; j++){
option[j].removeAttribute("selected");
}
option['.$i.'].setAttribute("selected","selected");
select.onchange();
</script>';
which works in console but not by echoing by php