title: How do I retrieve last console output of a jenkins job using python-jenkins?
body: <p>I'm unable to extract the jenkins  console output of a given job using python-jenkins. I must to extract the full console output of a given build #.</p>
  
  <p>Here is how my jenkins url looks like:<br>
  <a href="http://jenkins.abc.xyz.io:8080/job/myapp-build/46/consoleFull" rel="nofollow noreferrer">http://jenkins.abc.xyz.io:8080/job/myapp-build/46/consoleFull</a>
  and It has valid output.</p>
  
  <p>As per <a href="https://python-jenkins.readthedocs.io/en/latest/api.html#jenkins.Jenkins.get_build_console_output" rel="nofollow noreferrer">https://python-jenkins.readthedocs.io/en/latest/api.html#jenkins.Jenkins.get_build_console_output</a></p>
  
  <pre><code>get_build_console_output(name, number)
  Get build console text.
  
  Parameters: 
  name – Job name, str
  number – Build number, int
  Returns:    
  Build console output, str
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>import jenkins
  server = jenkins.Jenkins('http://jenkins.abc.xyz.io:8080', username='foo', password='foo!')
  
  jenkins_url = "http://jenkins.abc.xyz.io:8080"
  user = server.get_whoami()
  version = server.get_version()
  print('Hello %s from Jenkins %s' % (user['fullName'], version))
  #
  name='/myapp-build'
  number=46
  
  print server.get_build_console_output(name, number)
  
  </code></pre>
  
  <p>But it aborts saying</p>
  
  <pre><code>Traceback (most recent call last):
    File "test_jenkins.py", line 20, in &lt;module&gt;
      print server.get_build_console_output(name, number)
    File "/home/myapp/jenkins_py/env/jenkins/local/lib/python2.7/site-packages/jenkins/__init__.py", line 1630, in get_build_console_output
      % (name, number))
  jenkins.JenkinsException: job[/myapp-build] number[46] does not exist
  </code></pre>
  
  <p>Expected result would be the console output. </p>
  
  <p>What am I missing?</p>
  
  <p>Please help me extract the console output from jenkins using python.
  are there any alternate ways or libraries to accomplish it?</p>