Answers.Body: <p>If you want to download a file, you need to use the link <em>to that file</em>. Your original attempt, <code>wget  https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR7276474</code> wouldn't work since that's a link to the trace page of the relevant run. If you want to download something else, just right click on the link (the one in the screenshot in your question), copy the URL and use that:</p>
  
  <pre><code>wget https://sra-download.ncbi.nlm.nih.gov/traces/sra64/SRZ/007276/SRR7276474/P1TLH.bam
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-04T15:48:04.753Z
Answers.LastActivityDate: 2019-02-04T15:48:04.753Z
Answers.UserDisplayName: terdon
Answers.Body: <p>NCBI has its own digger for this purpose. No, my bad the traditional Perl approach of LWP and HTTP::Request::Common to interrogate NCBI, isn't going to work no how much data munging or spider crawling is done, because its just an NGS data dump. ... well its diggable, but it would be easier to dump the data and  interrogate it locally.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-04T20:16:08.963Z
Answers.Text: Please post the link and an explanation of how to use it, yes. Without it, this isn't really an answer. With it, it would become a very useful answer, much more so than my own.
Answers.UserDisplayName: terdon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-05T17:12:31.817Z
Answers.Text: Well it obviously isn't! :0) Its in Perl, so no-one understands that now
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-05T17:22:44.947Z
Answers.Text: Oy! Nothing wrong with Perl! Just because these young whippersnappers don't get its beauty, doesn't mean it isn't a great language! Joking apart, please edit the answer so it can stand on its own or just delete and post a comment instead. As you see, it's already attracted a downvote (not mine).
Answers.UserDisplayName: terdon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-05T17:42:09.443Z
Answers.Text: No, I just didn't get around to doing it and when I get around to it I'll update the post
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-04T16:33:32.517Z
Answers.LastActivityDate: 2019-02-06T16:05:29.083Z
Answers.LastEditDate: 2019-02-06T16:05:29.083Z
Answers.UserDisplayName: M__
Body: <p>I am trying to download a file from the following repository: <a href="https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR7276474" rel="nofollow noreferrer">https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR7276474</a> </p>
  
  <p>As you can see, there are several layers to the webpage. For example, clicking on the download tab doesn't change the URL and, the link is not a 'download link' per ce - where simply clicking the link automates a download. I have tried some of the answers on the forum, where they have advised using quotes and the operation: 
  <code>wget "url/?target=link"</code>. This however does not work in the following instance.</p>
  
  <p>Basically, I want to download the file labeled 'P1TLH.bam', in the download tab of the link provided:</p>
  
  <p><a href="https://i.sstatic.net/Fv2nN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Fv2nN.png" alt="screenshot showing the link"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T15:40:47.233Z
Comments.Text: Thanks, found it. But doesn't `wget https://sra-download.ncbi.nlm.nih.gov/traces/sra64/SRZ/007276/SRR7276474/P1TLH.bam` work?
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T15:45:54.600Z
Comments.Text: It does! Thank you so much. What is the logic behind it though? Don't quite understand why the original command was not working..
Comments.UserDisplayName: h3ab74
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T15:48:37.177Z
Comments.Text: Because you weren't using the link to that file, presumably. Wget will download what you tell it to, so you need to tell it to get the target of the link you want.
Comments.UserDisplayName: terdon
Tags: <phylogenetics>
Title: wget for links inside html pages
ThreadText: # wget for links inside html pages
  
  (Asked by: username_0 on 2019-02-04)
  
  I am trying to download a file from the following repository: <https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR7276474>
  
  As you can see, there are several layers to the webpage. For example, clicking on the download tab doesn't change the URL and, the link is not a 'download link' per ce - where simply clicking the link automates a download. I have tried some of the answers on the forum, where they have advised using quotes and the operation:
  `wget "url/?target=link"`. This however does not work in the following instance.
  
  Basically, I want to download the file labeled 'P1TLH.bam', in the download tab of the link provided:
  
  [![screenshot showing the link](https://i.sstatic.net/Fv2nN.png)](https://i.sstatic.net/Fv2nN.png)
  
  **Tags:** phylogenetics
  
  > **Comments:**
  > **username_1**: Thanks, found it. But doesn't `wget https://sra-download.ncbi.nlm.nih.gov/traces/sra64/SRZ/007276/SRR7276474/P1TLH.bam` work?  
  > **username_0**: It does! Thank you so much. What is the logic behind it though? Don't quite understand why the original command was not working..  
  > **username_1**: Because you weren't using the link to that file, presumably. Wget will download what you tell it to, so you need to tell it to get the target of the link you want.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-02-04. Score: 1 | Accepted answer
  
  If you want to download a file, you need to use the link *to that file*. Your original attempt, `wget https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR7276474` wouldn't work since that's a link to the trace page of the relevant run. If you want to download something else, just right click on the link (the one in the screenshot in your question), copy the URL and use that:
  
  ```
  wget https://sra-download.ncbi.nlm.nih.gov/traces/sra64/SRZ/007276/SRR7276474/P1TLH.bam
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2019-02-04. Score: -1
  
  NCBI has its own digger for this purpose. No, my bad the traditional Perl approach of LWP and HTTP::Request::Common to interrogate NCBI, isn't going to work no how much data munging or spider crawling is done, because its just an NGS data dump. ... well its diggable, but it would be easier to dump the data and interrogate it locally.
  
  > **Comments:**
  > **username_1**: Please post the link and an explanation of how to use it, yes. Without it, this isn't really an answer. With it, it would become a very useful answer, much more so than my own.  
  > **username_2**: Well it obviously isn't! :0) Its in Perl, so no-one understands that now  
  > **username_1**: Oy! Nothing wrong with Perl! Just because these young whippersnappers don't get its beauty, doesn't mean it isn't a great language! Joking apart, please edit the answer so it can stand on its own or just delete and post a comment instead. As you see, it's already attracted a downvote (not mine).  
  > **username_2**: No, I just didn't get around to doing it and when I get around to it I'll update the post  
  
  ---
  
  