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

CallMethodException: calling method: Page.printToPDF error: PrintToPDF is not implemented #46

Closed
fpom opened this issue Nov 5, 2019 · 1 comment

Comments

@fpom
Copy link

fpom commented Nov 5, 2019

I try to use tab.Page.printToPDF() but it fails complaining its not implemented:

>>> import pychrome                                                         
>>> browser = pychrome.Browser(url="http://127.0.0.1:9222")                 
>>> tab = browser.new_tab()                                                 
>>> tab.start()                                                             
True
>>> tab.Page.navigate(url="file:///home/franck/Desktop/svg/hello.svg")      
{'frameId': '6AB6826A1AD497075326A65B53088ACD',
 'loaderId': '1044382648C5CBD3CA18C80DFABA79B2'}
>>> tab.Page.printToPDF()                                                   
/home/franck/.anaconda3/lib/python3.7/site-packages/pychrome/tab.py:176: UserWarning: Page.printToPDF error: PrintToPDF is not implemented
  warnings.warn("%s error: %s" % (_method, result['error']['message']))
---------------------------------------------------------------------------
CallMethodException                       Traceback (most recent call last)
<ipython-input-6-077e1649bd93> in <module>
----> 1 tab.Page.printToPDF()

~/.anaconda3/lib/python3.7/site-packages/pychrome/tab.py in call_method(self, _method, *args, **kwargs)
    175         if 'result' not in result and 'error' in result:
    176             warnings.warn("%s error: %s" % (_method, result['error']['message']))
--> 177             raise CallMethodException("calling method: %s error: %s" % (_method, result['error']['message']))
    178 
    179         return result['result']

CallMethodException: calling method: Page.printToPDF error: PrintToPDF is not implemented

I have Python 3.7.4, and installed pychrome 0.2.3 from the git repo. I've had this error for both google-chrome and chromium, using Linux.

Thanks for your help!

@fate0
Copy link
Owner

fate0 commented Dec 3, 2019

enable chrome headless mode

@fate0 fate0 closed this as completed Dec 3, 2019
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