Score:0

wget can't find url inside local file

ug flag

I have an html file. page.html:

<html>
    <body>
    <img src="picture.png">
    </body>
</html>

But when i run wget as follows, it doesn't fetch the picture. Why? In the moment of execution, i am inside my home directory, while the page and the respective picture are inside /tmp directory.

wget -kF -i /tmp/page.html -B /tmp -A png

wget output:

No URLs found in /tmp/page.html.
Converted links in 0 files in 0 seconds.

Maybe it's a little bit easy, but i can't cope with it now.

Score:0
om flag

From man wget

       If this function is used, no URLs need be present on the command
       line.  If there are URLs both on the command line and in an input
       file, those on the command lines will be the first ones to be
       retrieved.  If --force-html is not specified, then file should
       consist of a series of URLs, one per line.

You have to specify --force-html

This will output the error message /tmp/foo.html: Cannot resolve incomplete link picture.png. as it's not a full URL, and relative URL's doesn't really make sense with a local file.

mathway avatar
ug flag
`-F` option is a short alternative to `--force-html`, and in the example above I use it. So, if `html` document uses relative links on the server it's being located, you say i can't download documents to which these relative links point? If I can instead, how can I do that?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.