Downloading PDB files from BindingDB by script : I am trying to find a way to download PDB files of a proteins that have co-crystalized ligand by using BindingDB. So, I have a file with different BindingDB IDS, and I want for each ID to download pdb files for each ligand that binds to that protein. Previously I was using a script to download directly specific PDB files from RSCB: PDB, but now I have to do the same, but I have BindingDB IDs.

Previous script that I've used looks like this:

    #! usr/bin/perl -w
    
    open (NDX, 'file.txt');
    @ndx_ar = <NDX>;
    close NDX;
    $ndx_sz = scalar@ndx_ar;
    for ($c = 0; $c < $ndx_sz; ++$c)
    {
         chomp $ndx_ar[$c];
         if ($ndx_ar[$c] =~ /pdb/)
         {
          $ndx_ar[$c] =~ s/.pdb//;
          `wget 'http://www.pdb.org/pdb/download/downloadFile.do?fileFormat=pdb&compression=NO&structureId=$ndx_ar[$c]' -O $ndx_ar[$c].pdb`;
         }
         else
         {
          `wget 'http://www.pdb.org/pdb/download/downloadFile.do?fileFormat=pdb&compression=NO&structureId=$ndx_ar[$c]' -O $ndx_ar[$c].pdb`;
         }
    }
    
    exit;

Maybe some other way to download these data exists, but I couldn't find it so far.

Many thanks!