http://www.perlmonks.org?node_id=1048475


in reply to Re: Selenium get_page_source function
in thread Selenium get_page_source function

Yes Caveat, get_page_source it returns html page , but as the downloading file is zip file, when you open the file it will not in html characters, some junk, Yes the file have size, do we need to use encode/decoding so that file will formed correct without damaging

  • Comment on Re^2: Selenium get_page_source function

Replies are listed 'Best First'.
Re^3: Selenium get_page_source function
by Illuminatus (Curate) on Aug 08, 2013 at 15:44 UTC
    Your code example shows it writing the return from get_page_source to the file that you're renaming to ".zip". I wasn't sure if some additional transformation was necessary to remove the html 'wrapper'. These are the things I would do (some of which you may have already done):
    1. Download the zip file manually and verify that you can unzip it
    2. If you're on a *nix system, run 'sum file.zip' and 'file file.zip' on the file and keep the results
    3. Verfiy the 'content-encoding:' is what you expect
    4. Once you use your script to download, use 'sum' and 'file' on the result(s) to look for differences

    fnord