Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
259 views
in Technique[技术] by (71.8m points)

html - How can I find the source code for a website using only cmd?

Ok, so here's the web page: https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/vfr/

What I want to do is download the source of that web page (the equivalent of right-clicking in a browser and selectin View Source), but I need to do it in a batch file without the use of outside tools like wget. I know how to download files using bitsadmin in a batch file, but I'm running into trouble because I don't know the actual URL of the web page. I've tried adding index.html and index.htm and all sorts of page names to the end and none of the are valid. So how can I find the ACTUAL page name to download?

More info for those who care: the purpose is to parse the code to determine the ever-changing filenames of the GEO-TIFF files on the page, then download those files automatically (rather than needing to manually right-click on each file and save-as about 55 times).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use curl.

When you type curl followed by an HTTP address the output will be the source code of the page.

curl http://yourAddress.com > tmp.txt

The result will be stored in a tmp.txt file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...