I can perfectly download this link and save it as a text file in a web browser environment. But I can't download and save that wikipedia api request using neither wget nor curl. I use wget -O file.txt https://that-ugly-url
, but it contains a different html content rather than the correct api reply which I'm able to download using a browser.
答案1
Put the link between quotation marks like below. In most of the shells ?,& have special meanings.
wget -O file.txt "https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&rvsection=0&titles=wikipedia&format=php"