maaaaz / webscreenshot

A simple script to screenshot a list of websites
GNU Lesser General Public License v3.0
657 stars 163 forks source link

Webscreenshot.py making a weird screenshot (used within different python script) #56

Closed jefferu closed 4 years ago

jefferu commented 4 years ago

Hi currently im using the take_screenshot function from another python script. Using python 3.6 on Ubuntu

options = argparse.Namespace(URL=None, ajax_max_timeouts='1400,1800', cookie=None, crop=None, format='png', header=None, http_password=None, http_username=None, imagemagick_binary=None, input_file=None, label=False, log_level='DEBUG', multiprotocol=False, no_xserver=True, output_directory=path, port=None, proxy=None, proxy_auth=None, proxy_type=None, quality=75, renderer='phantomjs', renderer_binary=None, ssl=False, timeout=30, verbosity=2, window_size='1200,800', workers=4) -> take_screenshot(url_container, options)

the url container just contains a bunch of urls.

The output which gets generated on a specific page which I want to monitor looks like this balken

but it should look more like this balken 2

why does this happen?

maaaaz commented 4 years ago

Hello,

Absolutely no idea but you can try to:

  1. With phantomjs, adjust timeouts
  2. Change the renderer, using chrome for instance

Cheers.

jefferu commented 4 years ago

2. Change the renderer, using chrome for instance

how exactly do I accomplish that?

maaaaz commented 4 years ago
  1. Install Chrome on your system
  2. Launch webscreenshot specifying -r chrome and --renderer-binary /path/to/the/chrome/executable
jefferu commented 4 years ago

do i have to change/edit any other parameters as shown above? Is it only the path to the renderer binary and the renderer? Since I read that some of those options are not available for other renderer beside phantomjs

maaaaz commented 4 years ago

"Is it only the path to the renderer binary and the renderer"

Yes

Choosing a renderer is always an available option. But, some advanced options for processing are not available for each renderer.