Help:Downloading pages
Appearance
Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info. |
Downloading a MediaWiki page
[edit]Web browsers may provide the option for saving a HTML copy of a web page.
Alternatively, or additionally, you can copy the wikitext , which is the text found in the edit box (the source code within the database), and save it to a file having a file type of .wiki
.
The HTML copy contains information not visible on the wikitext, such as:
- The content of referenced templates and magic words.
- Existence of linked internal pages at the time of saving.
- Date and time of the last edit before saving.
- For images in the image namespace: The image, its history, and pages linking to it.
- For Category namespace: Lists of subcategories and pages within the category.
- Results of expressions like
{{#expr:..}}
.
The wikitext contains information not visible from the HTML, such as:
- Comments (also allowed in HTML)
- Names of variables, parser functions, and templates referenced.
- Numerical expressions in
{{#expr:..}}
tags.
Additionally, you could save the wikitext, template documentation, and intermediate processing results like the XML parse tree and expanded wikitext.
Downloading linked pages
[edit]When saving MediaWiki pages locally, remember these points:
- To prevent the HTML href attribute link from being automatically converted to its full URL (e.g., from
/wiki/Train
to http://en.wikipedia.org/wiki/Train), use the "View source" option and save the HTML code directly. - Put the files in a
wiki
folder at the root of a drive (likeC:/wiki
) with no file extension. This allows links to work, but you can't open files by clicking on them in the folder list due to the absence of file extensions. - Saving the HTML code doesn't automatically save images. It's inconvenient to save the images separately in a location that matches the HTML code, such as saving the first image of the train article as
C:/upload/thumb/c/c2/250px-Tile_Hill_train_550.jpg
. - If the images on the webpage are more important to you than its links, you can use the browser's "Save Page As" or "Save Page with Images" option to download the webpage along with its images.
- Customizations are possible by modifying the HTML code, such as changing the URL to a local path (e.g.,
C:
) and/or adding a file extension (e.g.,.html
). - On some websites beyond Wikimedia, a different folder name is required instead of
/wiki
to access specific pages, as explained at Help:URL resource. - When downloading web pages from various websites to a single folder (
/wiki
) on the same drive, each page can only be saved with a unique name, as duplicates are not allowed.
See also
[edit]- Database download
- Help:Export - XML export
- MediaWiki architecture