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_init
CURL_INIT(3) 1 CURL_INIT(3)
curl_init - Initialize a cURL session
SYNOPSIS
resource curl_init NULL ([string $url])
DESCRIPTION
Initializes a new session and return a cURL handle for use with the curl_setopt(3), curl_exec(3), and curl_close(3) functions.
PARAMETERS
o $url
- If provided, the CURLOPT_URL option will be set to its value. You can manually set this using the curl_setopt(3) function.
Note
The file protocol is disabled by cURL if open_basedir is set.
RETURN VALUES
Returns a cURL handle on success, FALSE on errors.
EXAMPLES
Example #1
Initializing a new cURL session and fetching a web page
<?php
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>
SEE ALSO
curl_close(3), curl_multi_init(3).
PHP Documentation Group CURL_INIT(3)