-
Notifications
You must be signed in to change notification settings - Fork 131
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
运行出错 #7
Comments
请问你使用的是ChromeDriver吗?因为不同的WebDriver在headless模式下的渲染方式是不一样的,所以有些浏览器可能会造成element没有全部渲染 |
是使用的ChromeDriver。 |
@ivoidcat @snow212-cn |
@snow212-cn |
截取完整全屏图片就是利用headless的特性,所以headless是需要的
当然如果你有兴趣的话,也可以自学一下selenium,没准你会有更好的解决方案,也欢迎大家讨论交流 |
edge |
哪个是可以运行 |
Wait for QRCode Scan...0/15turns
Login Succeed.
Task launching...
navigate to https://weread.qq.com/web/reader/50532a905cde3050538da2b
preparing to scan "竞争战略"
scanning chapter "推荐序1"
Traceback (most recent call last):
File "/Users/zhigangyang/development/WXRead/WX.py", line 15, in
weread.scan2pdf('https://weread.qq.com/web/reader/50532a905cde3050538da2b')
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/WeReadScan/WeRead.py", line 171, in scan2pdf
self.shot_full_displayed_element(context, f'{png_name}.png')
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/WeReadScan/WeRead.py", line 60, in shot_full_displayed_element
element.screenshot(file_name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 585, in screenshot
png = self.screenshot_as_png
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 567, in screenshot_as_png
return base64.b64decode(self.screenshot_as_base64.encode('ascii'))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 557, in screenshot_as_base64
return self._execute(Command.ELEMENT_SCREENSHOT)['value']
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/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."}
The text was updated successfully, but these errors were encountered: