wget -k não converte todos os links

3

Estou tentando espelhar um site completo para outro domínio.

Estou tentando usar

wget -mk http://example.com

No entanto, a opção -k deixa algumas URLs originais, enquanto outras são convertidas, como:

  

<link rel="stylesheet" href="http://example.com/templates/css/style.css" type="text/css" />
<!--[if lt IE 8]>
  <link rel="stylesheet" href="/templates/css/ie.css" type="text/css" />
<![endif]-->
<!--[if lt IE 7]>
  <link rel="stylesheet" href="/templates/css/ie6.css" type="text/css" />
<![endif]-->

Ou tags img:

<img src="http://example.com/templates/img/logo.jpg"

Enquanto as tags a são convertidas corretamente.

Estes são de index.html e a saída de estados wget, que index.html foram convertidos

Converting example.com/index.html... 30-12

Por que isso acontece?

    
por fdafgfdgfagfdagfdagfdagfdagfda 06.02.2015 / 15:01

2 respostas

1

Isso na página de manual do wget, que provavelmente explica o que você está vendo:

-k --convert-links

After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc.

Each link will be changed in one of the two ways:

  • The links to files that have been downloaded by Wget will be changed to refer to the file they point to as a relative link.

Example: if the downloaded file /foo/doc.html links to /bar/img.gif, also downloaded, then the link in doc.html will be modified to point to ../bar/img.gif. This kind of transformation works reliably for arbitrary combinations of directories.

  • The links to files that have not been downloaded by Wget will be changed to include host name and absolute path of the location they point to.

Example: if the downloaded file /foo/doc.html links to /bar/img.gif (or to ../bar/img.gif), then the link in doc.html will be modified to point to http://hostname/bar/img.gif.

Sem mais detalhes, é difícil ser mais preciso.

    
por 06.02.2015 / 16:23
0

Pode ser que haja um arquivo robots.txt no servidor. A opção -e robots=off ajudaria nesse caso. (Fez para mim em uma situação semelhante.)

    
por 08.09.2016 / 18:33

Tags