1

I'm wondering if anyone has come across a way of downloading only parts of .html file rather than the whole file.

I'm aware that wget allows access but it appears that it cannot be customized to download only the first 50 bits or the last 50 bits of the file.

Any suggestions would really be appreciated. If it's not possible, I think I'm going to try to make it, so let me know if you have any suggestions for that as well.

Thanks, Alex

1 Answers1

1

wget does a HTTP request and this simply means that a server will answer by serving the requested file. You can write your own socket and cut off after the first 50 bytes but you cannot skip the beginning of it, the http protocol simply doesn't do that; you request a file and you get it, that's how it's written. However, after receiving, you are free to save just parts of it.

Saskia
  • 474
  • 5
  • 13
  • Hmm... interesting. Thanks for your reply. In order to receive the file though I would still have to download it though, correct? I ask because part of my curiosity with this project is to minimize data downloads needed for web browsing. – itchyspacesuit Sep 06 '16 at 01:23
  • I've been reading up a bit and came across this: http://stackoverflow.com/questions/21775860/python-how-to-download-file-using-range-of-bytes?noredirect=1&lq=1 – itchyspacesuit Sep 06 '16 at 01:39
  • Well it depends on what you're using, in case of wget: yes, then it will first download the file and you can then process it later. – Saskia Sep 06 '16 at 06:05
  • Hmmm... okay. Thanks for your thoughts. I'll update this post if I come across anything that solves this issue. Have a great week! – itchyspacesuit Sep 06 '16 at 16:05