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

Cannot take screenshot with 0 width #44

Open
JPDMonkey opened this issue Dec 28, 2020 · 4 comments
Open

Cannot take screenshot with 0 width #44

JPDMonkey opened this issue Dec 28, 2020 · 4 comments

Comments

@JPDMonkey
Copy link

JPDMonkey commented Dec 28, 2020

I am trying to download few mangas from the site but seems like it is no longer possible
config:

- manga: https://www.japscan.se/manga/mint-na-bokura/
- manga : https://www.japscan.se/manga/switch-girl/

File "/usr/local/lib/python3.7/dist-packages/selenium-3.141.0-py3.7.egg/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.7/dist-packages/selenium-3.141.0-py3.7.egg/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Cannot take screenshot with 0 width."}
(Session info: headless chrome=87.0.4280.88)

@Harkame
Copy link
Owner

Harkame commented Jan 11, 2021

I have tried both managas and it seems to work for me

I have update all softwares to new version :

  • chrome : 87.0.4280.141
  • chromedriver : 87.0.4280.88
  • japscandownloader : 1.0.6

There is my config file

  destination_path: ./mangas/
  
  format: jpg
  
  mangas:
    - manga : https://www.japscan.se/manga/switch-girl/

Are you using linux or windows ? The error appear during download at a specific page or at the first page ?

@JPDMonkey
Copy link
Author

config correspond, I am on ubuntu my version are:
chrome : 87.0.4280.141
chromedriver : 87.0.4280.88
japscandownloader : latest

This occurs on the first page

@JPDMonkey
Copy link
Author

Correct with windows it works somehow better, this was working with ubuntu before the site change to se
However with windows now I have missing pages in between

@JPDMonkey
Copy link
Author

i made a fix to do more retry when None, so I have all the fixes:

line 362

    i = 1
    while (im == None):
        try:
            im = Image.open(BytesIO(image_element.screenshot_as_png))
        except Exception:  # Fail on get image
            logger.debug(f"error {i}: invalid image_element.screenshot_as_png")
            time.sleep(4)
            i += 1
    logger.debug(f"success after {i} retry")

with config

this is not working as the url is actually search for
https://www.japscan.se/lecture-en-ligne/switch-girl/1
where it should be
https://www.japscan.se/lecture-en-ligne/switch-girl/volume-1
so I made also a quick and dirty fix, problably need to check if url exist otherwise test with volume-,....

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

2 participants