Hot Topic (More than 10 Replies) CGI forms on the Web (Read 3428 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
CGI forms on the Web
Dec 21st, 2012 at 5:29pm
Print Post Print Post  
Erika had demonstrated using @HTTPPOSTHTML ( ) and @HTTPGETHTML ( ) commands to post data from withing Sesame and get the resultant data in Sesame. I have been trying unsuccessfully to use this commands effectively to fill out the web forms and get the data in Sesame. My question is: Is there someone out there using the above commands and successfully interacting with the web forms? I will appreciate your response as successful use by anyone of you will inspire me to continue trying and not giving up easily. Thanks.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: CGI forms on the Web
Reply #1 - Dec 21st, 2012 at 6:20pm
Print Post Print Post  
Where are these web forms?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: CGI forms on the Web
Reply #2 - Dec 21st, 2012 at 7:23pm
Print Post Print Post  
Here's a simple example of one of the ways I use @HTTPGetHTML to open a webpage. When I don't want to open a webpage, but only want to extract data from a page, I will use @RegexBetweenString on the vHTML variable to parse out what I want. (I don't think I've ever used @HTTPPostHTML.)

Code
Select All
	vPath = "/?q=" + vAddress + "%20" + vCity + "%20" + vState + "%20" + vZip
	vHTML = @HTTPGetHTML(vServerName, vPath, "", 80)

	vHTML = @AsynchShell("http://" + vServerName + vPath)
 

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: CGI forms on the Web
Reply #3 - Dec 21st, 2012 at 8:18pm
Print Post Print Post  
Most of the form I have to sign in before I get to the form. That is another hurdle I have to overcome. But for the first step I was trying to use USPS.com to get the zipcode from the address.

https://tools.usps.com/go/ZipLookupAction_input

using @HttpPostHtml ( ) to post to the form and @HttpGetHtml ( ) to get the sorce of the html page displaying results. Some how or the other I am getting empty string - (empty slate).  Thanks.

Carl, can you tell me on what website your code will work? This is to see the concrete example. Have figured out a way to sign in automatically, that is using sbasic to authenticate? Thanks.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: CGI forms on the Web
Reply #4 - Dec 21st, 2012 at 8:44pm
Print Post Print Post  
Is there a way that I can  attach here a .htm file of the form that I need to fill out?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: CGI forms on the Web
Reply #5 - Dec 21st, 2012 at 8:54pm
Print Post Print Post  
The problem is https. These commands won't work with a secure form. You'll need to use cURL.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: CGI forms on the Web
Reply #6 - Dec 22nd, 2012 at 5:17am
Print Post Print Post  
I have a cURL solution that I've been using to retrieve ZIP codes from USPS.com. Do you want to see it?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: CGI forms on the Web
Reply #7 - Dec 22nd, 2012 at 7:31am
Print Post Print Post  
Yes Carl. That would be very useful. I believe, I will have to learn using cURL. Any suggestion about about reading material to introduce myself to cURL utility? Thanks for your help.
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: CGI forms on the Web
Reply #8 - Dec 22nd, 2012 at 4:41pm
Print Post Print Post  
I'm planning on submitting it for an Inside Sesame article soon, so I'll PM you with details.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: CGI forms on the Web
Reply #9 - Dec 22nd, 2012 at 5:59pm
Print Post Print Post  
Thanks Carl.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: CGI forms on the Web
Reply #10 - Dec 24th, 2012 at 6:41am
Print Post Print Post  
I would be interested to see how cURL is used to authenticate and successfully submit SSL certificate in HTTPS webpage to even go to the page where data has to be posted in the form. Where do I get the SSL certificate? Where are they stored? As I understand, different browsers store them in different format and one might have to convert them in the acceptable format and then present it.  I truly find this daunting!!
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: CGI forms on the Web
Reply #11 - Dec 24th, 2012 at 3:34pm
Print Post Print Post  
Unless you believe that the server is not who it is claiming to be, you can run cURL with the --insecure flag (-k) and it will bypass certificates and simply use SSL.

http://curl.haxx.se/docs/sslcerts.html
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged