html2image icon indicating copy to clipboard operation
html2image copied to clipboard

Capture screenshot is disabled when remote debugging is enabled.

Open amandugar opened this issue 2 years ago • 4 comments

hti = Html2Image(custom_flags=['--disable-remote-debugging', '--no-sandbox'])  
      
  try: 
      hti.screenshot(html_file='index1.html',
                    save_as='Image-1.jpg',
                    size=(1200, 1200)
                    )

      hti.screenshot(html_file='index2.html',
                      save_as='Image-2.jpg',
                      size=(1200, 1200)
    )
  except:
    print(e)
  
  return ['Image-1.jpg', 'Image-2.jpg']

amandugar avatar Feb 21 '22 20:02 amandugar

Facing this issue in flask and using server as heroku

amandugar avatar Feb 21 '22 20:02 amandugar

Hello, could you take a look at the issue #39 , particularly at this comment to see if it solves your problem ?

I quote aurelmegn:

Capture screenshot is disabled when remote debugging is enabled Hey, in case someone is having this error issue with heroku, the chrome build pack enable remote debugging by default, and you need to remove the flag --remote-debugging-port=9222 in the build pack before using it.

vgalin avatar Feb 21 '22 20:02 vgalin

Hello, could you take a look at the issue #39 , particularly at this comment to see if it solves your problem ?

I quote aurelmegn:

Capture screenshot is disabled when remote debugging is enabled Hey, in case someone is having this error issue with heroku, the chrome build pack enable remote debugging by default, and you need to remove the flag --remote-debugging-port=9222 in the build pack before using it.

Thanks for the quick help it helped me And yes its an issue

amandugar avatar Feb 21 '22 21:02 amandugar

image This suggests we should add a version as a flag

amandugar avatar Feb 21 '22 21:02 amandugar