[Biopython] Retrieving miRNA target data from TargetScan

Peter biopython at maubp.freeserve.co.uk
Wed Feb 24 07:53:43 UTC 2010


On Tue, Feb 23, 2010 at 10:02 PM, Angel Villahoz-baleta
<villahozbale at wisc.edu> wrote:
> Hi, Abu,
> I do not have your same Python and Biopython environments.
> But I have executed your same call to urllib with a slight modification to
> set the input argument as a string:
>
> import urllib
>
> f =
> urllib.urlopen('http://www.targetscan.org/cgi-bin/targetscan/vert_50/targetscan.cgi?species=Human&mirg=hsa-mir-100')
>
> And it was okay, only that you have received some typical HTML source code
> which you would have to parse it...

The example also seems to work for me, I'm assuming Nizar had quotes
round the URL that got lost in the original email formatting. e.g. try this:

import urllib
url = "http://www.targetscan.org/cgi-bin/targetscan/vert_50/targetscan.cgi?species=Human&mirg=hsa-mir-100"
f = urllib.urlopen(url)
print f.read()

The original error message could just have been a network error:
>> IOError: [Errno socket error] [Errno 10061] No connection could be made
>> because the target machine actively refused it

In any case, I would second Sean's suggestion to try downloading
the raw data via FTP, rather than trying to parse a webpage.

Peter



More information about the Biopython mailing list