Alright so basically, I can post to this website http://ift.tt/1pQf19g like thishttp://elementalknives.com/cart/21977860165:1? checkout[email]=x@outlook.com &checkout[shipping_address][first_name]=XXX &checkout[shipping_address][last_name]=XXX &checkout[shipping_address][address1]=XXXXX &checkout[shipping_address][city]=England &checkout[shipping_address][province]=Arizona &checkout[shipping_address][zip]=85001 &checkout[shipping_address][phone]=07129151286 &checkout[shipping_address][country]=United States and when I goto this link, all the textboxes I need to be filled are full, the next step would be clicking 'continue to shipping method', and I'm wondering how I will simulate clicking the button 'continue to shipping method', I know it posts to the same url with?previous_step=contact_information&step=shipping_method, however the data I posted above already wouldn't be stored for example all the textboxes, so when i post like thishttp://elementalknives.com/cart/21977860165:1? checkout[email]=x@outlook.com &checkout[shipping_address][first_name]=XXX &checkout[shipping_address][last_name]=XXX &checkout[shipping_address][address1]=XXXXX &checkout[shipping_address][city]=England &checkout[shipping_address][province]=Arizona &checkout[shipping_address][zip]=85001 &checkout[shipping_address][phone]=07129151286 &checkout[shipping_address][country]=United States &previous_step=contact_information &step=shipping_method It says 'Please enter your shipping information.'I assume this is because it doesn't save the text boxes values ?How would I save these values and submit that so it takes me to the next page?If I goto the original POSTED URL, and I click the continue button it takes me to the next step, so I'm unsure how I will do this.Here is what my code looks likevar request = require('request'); var fs = require('fs'); var formData = { 'checkout[email]': 'X@outlook.com', 'checkout[shipping_address][first_name]': 'XXX', 'checkout[shipping_address][last_name]': 'XXX', 'checkout[shipping_address][company]': '', 'checkout[shipping_address][address1]': 'XXX Road', 'checkout[shipping_address][address2]': '', 'checkout[shipping_address][city]': 'XXX', 'checkout[shipping_address][country]': 'United States', 'checkout[shipping_address][province]': 'Arizona', 'checkout[shipping_address][zip]': '85001', 'checkout[shipping_address][phone]': '07129151286', 'previous_step': 'contact_information', 'step': 'shipping_method' }; request({ headers: { 'user-agent': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1' }, url: 'http://ift.tt/2oVMz6M', form: formData, method: 'GET' }, function (err, res, body) { fs.writeFile("temp.html", body, function(err) { if(err) { return console.log(err); } }); } ); I currently save the file to see if it successfully took me to the next stage, however it always never posts successfully and thinks I haven't inputted the shipping method when I post the same as them. I have taken a look at the cookies and there is no difference when it goes from the contact_information step to the shipping_method, so I'm confusedP.s I don’t want to use headless browsers, so please don’t suggest so :(
Submitted March 07, 2018 at 10:49PM by anonymouspls
No comments:
Post a Comment