07-24-2012
Using cURL to submit a post form
I am trying to write a shell script to use curl in order to automate downloading data from a website. The URL with the post form is here: http://try-db.org/de/InfoBySpecies.php .
I have a list of about 1800 different species I want to check. For Example, choose the first species and use the Queries option "Measurement table ...". The resulting page will contain a html table with the data. Getting to this stage would be nice progress, but eventually this script needs to parse out the download link and download the resulting tab delimited file.
Command:
curl --data "species=29&OutTab=tab1&submit=Submit&dummy=" http://try-db.org/de/InfoBySpecies.php
Any suggestions would be appreciated.
Cheers.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have searched for a good part of the day, but cannot seem to find an answer to this. I hope this is an appropriate forum for my question.
I am wanting to download a blog web page using a script. It requires username and password login. I have tried the following (an example) to no... (1 Reply)
Discussion started by: Allasso
1 Replies
2. Shell Programming and Scripting
Hi,
I have a custom HTML form that has a couple radio buttons and a text field that requires a number.
I'm not a php programmer and could use some help with putting together php code to calculate a total based on the radio button selection and the text field number.
... (3 Replies)
Discussion started by: nck
3 Replies
3. Shell Programming and Scripting
I'm trying to use wget to submit a form. I have tried to dig out what is actually being "posted" and where, using tamperdata (see below).
http://ubuntuforums.org/attachment.php?attachmentid=109123&d=1239224127
Here is my wget command:
wget --http-user=xyz --http-password=xyz... (1 Reply)
Discussion started by: mike909
1 Replies
4. Ubuntu
I'm trying to upload a file to a page using curl and after uploading that file i want to store the redirecting page so i can download the results.
I'm using the command:
curl "http://apps.gdgps.net/kag_upload.php?kag_type=static&kag_frequency=dual&kag_latency=accurate&... (8 Replies)
Discussion started by: limadario
8 Replies
5. Shell Programming and Scripting
hello
my script is submitting POST-data to a site
(its not my first script, i've done these before many times (include parsing scripts) but this one is tough)
so the problem is i'm submitting a form with firefox
and in firebug i see WHAT exactly i'm submitting
then
when i do EXACTLY the... (28 Replies)
Discussion started by: tip78
28 Replies
6. Shell Programming and Scripting
Hi All,
I am trying to post an xml file (utf-16 encoded) using curl to a REST service. The REST service is expecting 'multipart/form-data' content type.
curl -k -i -H "Content-Type=multipart/form-data" -F "filename=@file.xml;type=text/xml" -X POST -u <username>:<password> <endPointURL>
... (0 Replies)
Discussion started by: Anooja G
0 Replies
7. Shell Programming and Scripting
Hello,
I am looking to hit a URL using curl and click on submit button so that I can get the results. The below is the code
<input name="tos_accepted" id="tos_accepted" class="button" type="submit" value="Yes, I Agree"/>
<input name="tos_discarded" id="tos_discarded"... (1 Reply)
Discussion started by: Kochappa
1 Replies
8. Shell Programming and Scripting
Hi All,
I'm new in forum.
Many congratulations to everyone for all work.
I'm not an expert in bash script
I've a problem with a sh file.
The sh file run every t minuts and it read data from txt file and then compile form.
Finally, the user, from the web browser click on send.
The script... (0 Replies)
Discussion started by: Herbert
0 Replies
9. Web Development
I'm having an issue with curl post form, I dont' understand what I'm mising. I would like to send a post command login/password to a form, quite simple in the paper.
URL : http: // <myebsite> / login
Here the form source code :
<form action="/login_check" method="post">
<input... (3 Replies)
Discussion started by: Fred13
3 Replies
10. Web Development
Hi,
I write a new thread to discuss about my closed topic with new information ( /280990-curl-post-form-issue.html )
The previous post was closed because of missing informations, I didn't have access yet to server logs.
----------------------------------------------------------------------... (4 Replies)
Discussion started by: Fred13
4 Replies
LEARN ABOUT PHP
curl_escape
CURL_ESCAPE(3) 1 CURL_ESCAPE(3)
curl_escape - URL encodes the given string
SYNOPSIS
string curl_escape (resource $ch, string $str)
DESCRIPTION
This function URL encodes the given string according to RFC 3986.
PARAMETERS
o $ch
-A cURL handle returned by curl_init(3).
o $str
- The string to be encoded.
RETURN VALUES
Returns escaped string or FALSE on failure.
EXAMPLES
Example #1
curl_escape(3) example
<?php
// Create a curl handle
$ch = curl_init();
// Escape a string used as a GET parameter
$location = curl_escape($ch, 'Hofbrauhaus / Munchen');
// Result: Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen
// Compose an URL with the escaped string
$url = "http://example.com/add_location.php?location={$location}";
// Result: http://example.com/add_location.php?location=Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen
// Send HTTP request and close the handle
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>
SEE ALSO
curl_unescape(3), urlencode(3), rawurlencode(3), RFC 3986.
PHP Documentation Group CURL_ESCAPE(3)