This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Automatic Submission Of Input Data To Websites Using Matlab

I have to automate my submission of data into websites (ie fasta sequence to online blast and getting the result page into matlab). I was unsuccessful with urlread/urlwrite.

matlab

2 answers

You will need to use a tool that emulates a web browser: stores cookies, authenticates, submits forms etc. There are probably hundreds of approaches for just about all programming languages.

I usually use twill

Ah sorry haven't noticed the Matlab tag in the title. Even so you could just call twill in a system call from Matlab.

The method is heavily dependent from the used way of data submission. If it is via GET, then just attach the data in the proper way to the url (e.g. www.../query.php?data=myData). In case of a POST you might copy the query form. Try to call the web service using this local file. In case this works, you have to change the form such that the data is submitted on loading (some details). Finally, you can generate filled-out formulars with Matlab by setting default values in all text boxes or check boxes.

In parallel, you might take a look at the www:mechanize module. It comes for several programming languages and thus can be called indirectly by Matlab.

Log in to answer this question.