HTTP Request Help For Signup

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

HTTP Request Help For Signup

Post by CyberCitizen » Tue Mar 11, 2014 2:13 am

Hey Guys,

Need some expert advice here. I am trying to automate a trial account creation, however after the first HTTP Request I also need to send a second one to agree to the terms and conditions. Can anyone help me with this. I could do this with Web Recorder, however I am trying to avoid using IE if possible, also want to keep the speed that is HTTP Request.

Any assistance that can be provided with returning the second HTTP Request & pushing the I Agree POST would be much appreciated.

This gives you an example of the next screen that appears. Note it will be creating a new account each day, so I don't know if the second POST request needs to be different each time.

Code: Select all

http://member.hitnews.com/signup.php?product_id=7&name_f=Cyber&name_l=Citizen&[email protected]&login=ta20140311&pass0=ta20140311&pass1=ta20140311&coupon=&do_payment=1&price_group=
Current Script To Get To The First Part. If You Copy The Above URL, To A Browser You Will See The Next Screen That I Need To Agree To First Before A Confirmation Email Is Sent.

Code: Select all

Year>the_year
Month>the_month
Day>the_day
Let>vEmail=ta%the_year%-%the_month%-%the_day%
Let>vUserPass=ta%the_year%%the_month%%the_day%

Let>HTTP_TIMEOUT=15
Let>HTTP_REDIRECTS=1
HTTPRequest>http://member.hitnews.com/signup.php,,POST,product_id=7&name_f=Cyber&name_l=Citizen&email=%vEmail%@ThrowawayEmailAddress.com&login=%vUserPass%&pass0=%vUserPass%&pass1=%vUserPass%&coupon=&do_payment=1&price_group=,vHTML,,,,
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 11, 2014 7:02 am

Slightly hesitant to respond as I'm not sure of the ethics of automatically creating a new account every day but maybe you are the web master and want an automated test? Hopefully it is not as a way to avoid paying for their service and get around their 3 day trial.

You need to construct a POST based on this form:

Code: Select all

<form method="post" action="/signup.php">
    <strong>I Agree</strong> 
    <input type="checkbox" name="i_agree" value="1">

    <input type="submit" value="   Continue   ">
    <input type="hidden" name="do_agreement" value="1">
    <input type="hidden" name="data" value="a:12:{s:10:"product_id";s:1:"7";s:6:"name_f";s:5:"Cyber";s:6:"name_l";s:7:"Citize n";s:5:"email";s:38:"[email protected]";s:5:"login";s:10:"ta20140311";s:5:"pass0";s:10:"ta20140311";s:5:"pass1";s:10:"ta20140311";s:6:"coupon";s:0:"";s:10:"do_payment";s:1:"1";s:11:"price_group";s:0:"";s:6:"aff_id";N;s:9:"paysys_id";s:4:"free";}">
</form>
Note the fields including the hidden ones. Note the data field. Once you've done your first httprequest and retrieved the html you can parse the above data out and then use it in the POST parms when you do the next http.

If you use IE/Chrome/FF developer tools you can watch what data is sent when you do it manually so you can get an idea of how the POST parms should be constructed.

But essentially, you need to do your first http request, parse out the form data from the html, use that to construct POST parms to do another http request to the next page.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Mar 11, 2014 11:02 am

Hey Marcus,

I have tried posting the info that is received on the original post, however it doesn't appear to work. No email is received.

I have also tried using web recorder, however that doesn't seem to enter any data on the form? Are you seeing the same issue?
FIREFIGHTER

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Mar 11, 2014 11:08 am

Marcus Tettmar wrote:Slightly hesitant to respond as I'm not sure of the ethics of automatically creating a new account every day but maybe you are the web master and want an automated test?
Nothing sinister like that, needing to setup a reseller gateway, was wanting to automate the process.

Am using the trial as a test at present so not needing to provide payment details etc. The example of every day was to provide an example of at least processing a few requests & was easier to provide that in the sample.
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 11, 2014 1:14 pm

WebRecorder works for me, but I needed to remove "ACTION:/signup.php" and replace all occurrences with "" before it would play back. Obviously an issue with identifying the form element. Ignoring the form identifier - since there is only one form anyway - solves that.

So just do a search/replace, replacing all occurrences of "ACTION:/signup.php" with "".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed Mar 12, 2014 10:11 am

Thanks for that Marcus. Are you able to provide any further assistance with the second post request. I tried it, however it didn't seem to work, not sure what I was missing.
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Mar 12, 2014 10:15 am

I haven't tried it. You need to parse out the values, make sure they are escaped properly and do the post. There is a chance they are using session variables, in which case a second POST isn't going to work outside the browser because there is nothing to keep a session state. Given the hidden variables being sent it doesn't look like that is the case but I have no way of knowing.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Thu Mar 13, 2014 6:23 am

Hi Marcus,

I have tried what you suggested with Web Recorder, however kept getting the below error message. It seems to occur when I reference a variable.

---------------------------
Macro Scheduler
---------------------------
Line: 21 t not appropriate
---------------------------
OK
---------------------------

Code: Select all

Year>the_year
Month>the_month
Day>the_day
Let>vEmail=ta%the_year%-%the_month%-%the_day%@ThrowawayEmailAddress.com
Let>vUserPass=ta%the_year%%the_month%%the_day%
IEFormFill>%IE[0]%,{""},{""},{"email"},{"%vEmail%"},0,ie_res
IEFormFill>%IE[0]%,{""},{""},{"login"},{"%vUserPass%"},0,ie_res
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Mar 13, 2014 3:08 pm

If using variables you just need:

IEFormFill>%IE[0]%,{""},{""},{"email"},vEmail,0,ie_res
IEFormFill>%IE[0]%,{""},{""},{"login"},vUserPass,0,ie_res

{" ... "} is a literal string.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Sat Mar 15, 2014 6:42 am

I have tried the HTTP Request with the hidden values, however that has made no difference.

Code: Select all

Let>vPostData=product_id=2&name_f=Cyber&name_l=Citizen&[email protected]&login=CC140315&pass0=CC140315&pass1=CC140315&do_payment=1
HTTPRequest>http://member.xennews.com/signup.php,,POST,%vPostData%,vHTMLResult
Let>vPostData1=do_agreement=1&i_agree=1&data=a:10:s:10:"product_id";s:1:"2";s:6:"name_f";s:5:"Cyber";s:6:"name_l";s:7:"Citizen";s:5:"email";s:22:"[email protected]";s:5:"login";s:8:"cc140315";s:5:"pass0";s:8:"CC140315";s:5:"pass1";s:8:"CC140315";s:10:"do_payment";s:1:"1";s:6:"aff_id";N;s:9:"paysys_id";s:4:"free";}
HTTPRequest>http://member.xennews.com/signup.php,,POST,%vPostData1%,vHTMLResult
Does that mean that they are using Session Var or am I doing something wrong? Basically I have just duplicated the request using the details the form is requesting based on the hidden value.
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Mar 15, 2014 2:27 pm

Impossible for me to answer. You might need to urlencode that data first.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts