Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viewport_size not working with Google Maps #317

Open
Larckov opened this issue Nov 30, 2016 · 0 comments
Open

viewport_size not working with Google Maps #317

Larckov opened this issue Nov 30, 2016 · 0 comments

Comments

@Larckov
Copy link

Larckov commented Nov 30, 2016

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');
	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant