1

For this example, I know it is easier to use requests or similar python module.
But I need to do it with the ghost.py module

This code sample doesn't work:

from ghost import Ghost

ghost = Ghost()

with ghost.start() as session:
    page, extra_resources = session.open('http://www.7-zip.org/a/7z1506-x64.exe')

    with open('7z1506-x64.exe', 'wb') as file:
        file.write(session.http_resources)
baltazer
  • 259
  • 1
  • 5
  • 12

2 Answers2

0

I create some snippet here: https://github.com/jeanphix/Ghost.py/issues/273

But it's not final solution.

stdex
  • 359
  • 1
  • 6
  • 16
0

For Ghost.py (0.2.3)

    ...
    with open('7z1506-x64.exe', 'wb') as file:
        file.write(eval(extra_resources[0].content))
ruzzz
  • 31
  • 2