0

I use wget (Windows) to download webpages. On a site all works well but some webpages return a zero file. Here are commands i execute The first loads well with WGET, the second returns an empty file

This works fine and returns a file containing the source code of the page :

wget.exe -O pag.txt --restrict-file-names=nocontrol "http://www.goudengids.be/bedrijf/Hasselt/L2137456/Dehaese+%26+Dehaese+Advocatenkantoor/" >nul 2>nul

But this one does not work and returns a file pag.txt that is empty

wget.exe -O pag.txt --restrict-file-names=nocontrol "http://www.goudengids.be/bedrijf/L12587155/L6944363/L%C3%A9gat+%26+Joos+Advocatenkantoor/" >nul 2>nul

The problem is that the link contains %C3%A9 which is the UTF-8 code for the character "é"

How can I download the second url ? If you copy the the link directly in the addressbar of Google Chrome, the page loads fine.

Thank you for your help in advance and greetings from Belgium

2
  • Replace "é" with "%E9" as that is what it is in ISO-8859-1 (ECMA Latin1)?
    – Hannu
    Jul 16, 2022 at 9:12
  • I replaced %C3%A9 with %E9 in the link, but still I get a pag.txt that is empty so download does not work Jul 23, 2022 at 0:03

1 Answer 1

0

In PowerShell this command work well for me and download the desired page:

wget -O pag.txt "http://www.goudengids.be/bedrijf/L12587155/L6944363/L%C3%A9gat+%26+Joos+Advocatenkantoor/"
1
  • in PowerShell ? I call the wget from a Harbour program. This wget line you say that downloaded the page does not work, it results in a pag.txt of 0 (zero) bytes Jul 26, 2022 at 10:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .