I would like to process and convert all the files downloaded from wget in HTML format from a URL.

I want to convert a complete web page to DOCX format. We are talking about 3000 HTML documents downloaded from the URL. This task becomes tedious with Pandoc without automating.

Could it be automatically done in some way?

  • Do you want 3000 stand alone word docs or do you want one massive doc with internal links, etc?
    – ivanivan
    Apr 24 '18 at 0:44
  • when downloading the url with wget creates me 3000 html files, I would have them independent if possible, the content of the web page in docx. Apr 24 '18 at 2:08
  • look at the headless doc conversion option for open|libre office
    – ivanivan
    Apr 24 '18 at 2:17
  • what's the use if I can not agree with wget, you are not answering my question. Apr 24 '18 at 12:10

1. Convert after downloading

Whats the problem with using Pandoc on your saved HTML files?

Assuming your HTML are all in the a directory named wget-html, you could do the following:

 cd wget-html

 find . -name "*.docx" \
   | xargs -0     \
   pandoc         \
     --from=html  \
     --to=docx    \
     --toc        \
     --standalone \
     {} \;

This will create a PDF file for each "path/to/some.html" named "path/to/some.html.pdf".

2. Convert while downloading

If you want to achieve this, say so. But first please indicate which exact wget command you were using.

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.