viewport_size not working with Google Maps
Opened this issue · 0 comments
Larckov commented
Hi!
I've been playing around a bit with ghost.py and I was trying to capture a specific area in Google maps, but I the function viewport_size does not work in this case. In other sites works fine. If I use the display=True option, I can change the X parameter but not Y. I'm working under Debian testing. The code I am using is next. Any Idea what could it be the problem?
from ghost import Ghost;
ghost = Ghost();
with ghost.start(viewport_size=(1524,1524),display = False) as session:
page, extra_resources = session.open("https://www.google.com.mx/maps/place/Salamanca,+Spain/@40.9634332,-5.7042314,13z/data=!4m5!3m4!1s0xd3f265dc7dd7c45:0x2f7ae4d00bbfa9aa!8m2!3d40.9701039!4d-5.6635397?hl=en");
#assert page.http_status == 200;
ts = time.time();
name = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H-%M-%S');
im = session.capture();
im.save(path+name+'.jpg');