Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: WGET Syntax for a URL with cgi scripts.: msg#00017

web.wget.general

Subject: Re: WGET Syntax for a URL with cgi scripts.

Fred Holmes wrote:
The following fails, with error messages that don't make sense to me.

WGET -r -l2 -k -K -p -np -nd "http://thomas.loc.gov/cgi-bin/cpquery/0?r_t=a&r_n=107-791&submit=Search&variant=y&acronym=n&syndict=n&spq=n&sort_by_docid=n&d_q=on&dbname=cp107&maxdocs=100&report=hr791.107&xform_type=3&sel=TOCLIST&";

The URL is a valid one. (It's all one line, wrapped as you may receive it.) The URL works when copy/pasted into the address box of a browser.

It's the Table of Contents page of an html version of House Rept. 107-791. HTML is much easier to read than the .pdf version (which can be downloaded as a single file) or the ASCII version (which can also be downloaded as a single file.

I want to "snag" the entire document, which consists of "chapters" linked to the headings in the Table of Contents document.

It fails with different error messages depending upon whether I put the URL in quotation marks (as above) or not.

Which version of wget do you use? Would please you include the debug output with the error message if you are running the latest version (1.8.2). As you can see I have no problem with this page.
Yes, you should use quotes to protect the '?' and the '&' from your shell.

$ wget -d -O content.html "http://thomas.loc.gov/cgi-bin/cpquery/0?r_t=a&r_n=107-791&submit=Search&variant=y&acronym=n&syndict=n&spq=n&sort_by_docid=n&d_q=on&dbname=cp107&maxdocs=100&report=hr791.107&xform_type=3&sel=TOCLIST";
DEBUG output created by Wget 1.8.2 on cygwin.

--21:30:29-- http://thomas.loc.gov/cgi-bin/cpquery/0?r_t=a&r_n=107-791&submit=Search&variant=y&acronym=n&syndict=n&spq=n&sort_by_docid=n&d_q=on&dbname=cp107&maxdocs=100&report=hr791.107&xform_type=3&sel=TOCLIST
=> `content.html'
Resolving thomas.loc.gov... done.
Caching thomas.loc.gov => 140.147.249.9
Connecting to thomas.loc.gov[140.147.249.9]:80... connected.
Created socket 4.
Releasing 0x10029388 (new refcount 1).
---request begin---
HEAD /cgi-bin/cpquery/0?r_t=a&r_n=107-791&submit=Search&variant=y&acronym=n&syndict=n&spq=n&sort_by_docid=n&d_q=on&dbname=cp107&maxdocs=100&report=hr791.107&xform_type=3&sel=TOCLIST HTTP/1.0
User-Agent: Wget/1.8.2
Host: thomas.loc.gov
Accept: */*
Connection: Keep-Alive


---request end---
HTTP request sent, awaiting response... HTTP/1.1 200 OK
Date: Wed, 08 Jan 2003 20:30:30 GMT
Server: Web
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html


Length: unspecified [text/html]
Closing fd 4
Last-modified header missing -- time-stamps turned off.
--21:30:30-- http://thomas.loc.gov/cgi-bin/cpquery/0?r_t=a&r_n=107-791&submit=Search&variant=y&acronym=n&syndict=n&spq=n&sort_by_docid=n&d_q=on&dbname=cp107&maxdocs=100&report=hr791.107&xform_type=3&sel=TOCLIST
=> `content.html'
Found thomas.loc.gov in host_name_addresses_map (0x10029388)
Connecting to thomas.loc.gov[140.147.249.9]:80... connected.
Created socket 4.
Releasing 0x10029388 (new refcount 1).
---request begin---
GET /cgi-bin/cpquery/0?r_t=a&r_n=107-791&submit=Search&variant=y&acronym=n&syndi
ct=n&spq=n&sort_by_docid=n&d_q=on&dbname=cp107&maxdocs=100&report=hr791.107&xform_type=3&sel=TOCLIST HTTP/1.0
User-Agent: Wget/1.8.2
Host: thomas.loc.gov
Accept: */*
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... HTTP/1.1 200 OK
Date: Wed, 08 Jan 2003 20:30:31 GMT
Server: Web
Connection: close
Content-Type: text/html


Length: unspecified [text/html]

[ <=> ] 33,466 49.67K/s

Closing fd 4
21:30:31 (49.67 KB/s) - `content.html' saved [33466]




I haven't the foggiest idea how to obtain a "direct" address/URL for the document (Table of Contents) or for the links.

If WGET can't handle this is there any other application that will work here?

Thanks,

Fred Holmes



--
Med venlig hilsen / Kind regards

Hack Kampbjørn




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
user-groups.jax...    php.zend.framew...    os.solaris.open...    web.quixote.use...    java.openjdk.ho...    ietf.secmech/20...    gnu.glpk/2004-0...    recreation.cars...    network.smokepi...    linux.drivers.i...    cms.opencms.dev...    fonts.gfontview...    text.xml.soap.u...    voip.nist-sip/2...    debian.ports.hp...    xfree86.interna...    science.biology...    qnx.openqnx.dev...    mail.sylpheed.c...    busybox/bios/20...    emulators.kvm.s...    hardware.openco...    apple.fink.begi...    kde.german/2006...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation