javascript - Scraping AJAX based value php -
part of html code im trying info 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 change select 1 4 price in div changes link www.domain.com/product.html/ changes www.domain.com/product.html#/in-pack-5. problem conbination of domdocument, loadhtml, domxpathdoesnt seem recognize "#/in-pack-5" in link , keeps scraping default price when force "selected" value="4".
how can read second price than? ideas please im stuck. apologize if question been asked - searching answer hrs cant find anywhere or cant form question properply.
thanks in advance
edit
ok seems content (second price) loaded ajax , im told use link below reproduce php script have no idea how 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 appreciated
what ive figured out loop through option values , change them echoing javascript code , works getting values , changing state of select form. wanted echo onchange(); doesnt work. how can force onchange() on select form through php 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 not echoing php
Comments
Post a Comment