My aim is, to fetch below print history (XML) page,to my Debian box using wget,but not fetching contents of page. enter image description here

Commands Used:

wget -q

Result I got:

root@vm-debian:~/ar_lab# cat job_history.xml
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<HTML lang="en">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="text/javascript" http-equiv="Content-Script-Type">
<meta http-equiv="refresh" content="0; URL=/wcd/js_error.xml">
<BODY BGCOLOR="#ffffff" LINK="#000000" ALINK="#ff0000" VLINK="#000000" onload="location.replace('/wcd/index.html?access=JOB_DON');" >

1 Answer 1


It seems like your printer uses Javascript to redirect the page to the right location.

Wget does not understand Javascript.

The simple solution here would be for you to make the request directly to the redirected page:

$ wget -q
  • I tries this suggestion , but still no luck ( i.imgur.com/z3GcKx4.png )
    – Arun
    Feb 11, 2019 at 11:06
  • Please don't use images of text. It makes it very difficult to read. Update your original post with any new information
    – darnir
    Feb 11, 2019 at 12:48
  • Also, if you see the HTML source, it is making yet another javascript redirection. Unfortunately, you're going to have to manually follow all of these. None of the simple HTTP tools understand javascript. Selenium does, but it is too huge a project to throw at something this small.
    – darnir
    Feb 11, 2019 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.