I don't think this has much to do with Python, just a lot of Javascript and ajax.

Javascript part
$(document).on("click", ".product-details .custom-radio input:not(.active input)", function() { var elm = $(this); var root = elm.closest(".product-details"); var option = elm.closest(".custom-radio"); var opt, opt1, opt2, ip, ipr; elm.closest("ul").find("li").removeClass("active"); elm.closest("li").addClass("active"); if (option.hasClass("options1")) { ip = root.find(".options1").data("ip"); opt = root.find(".options2").data("opt"); opt1 = root.find(".options1 li.active input").val(); opt2 = root.find(".options2 li.active input").data("opt-sel"); } else ipr = root.find(".options2 input:checked").val(); $.ajax({ type: "POST", url: "/product/ajax/details.php", data: { opt: opt, opt1: opt1, opt2: opt2, ip: ip, ipr: ipr },
So you can just create the parameters (in this case, using the css selector would be better than xpath), post and analyze the json results.
source share