GithubHelp home page GithubHelp logo

Comments (2)

Forest-Dewberry avatar Forest-Dewberry commented on August 24, 2024

I found the solution. First of all, the fact that my program "stalled" in my terminal is not a problem - it simply means that the chrome process is ongoing. in order to resolve this apparent issue, which is more like a preference, I elected to open a different terminal, but I could have used:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=remote-profile&

The ampersand causes the program to run in the background.

Secondly, I had a problem executing:

>>> import PyChromeDevTools
>>> chrome =  PyChromeDevTools.ChromeInterface()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/PyChromeDevTools-0.1-py3.6.egg/PyChromeDevTools/__init__.py", line 43, in __init__
  File "/usr/local/lib/python3.6/site-packages/PyChromeDevTools-0.1-py3.6.egg/PyChromeDevTools/__init__.py", line 54, in connect
AttributeError: module 'websocket' has no attribute 'create_connection'

The cause of this error is that I had installed the wrong dependency with pip. Running "pip3 list" (I have two separate pip installations, one for python2.7 and one for python3, with symlinks pip and pip3 accordingly; if you only have python3 and use only one installation of pip, you're fine, don't worry about this) I got:

Package          Version  
---------------- ---------
certifi          2018.4.16
chardet          3.0.4    
cycler           0.10.0   
gevent           1.3.4    
greenlet         0.4.13   
idna             2.7      
kiwisolver       1.0.1    
numpy            1.14.1   
pip              10.0.1   
PyChromeDevTools 0.1      
pyparsing        2.2.0    
python-dateutil  2.7.0    
requests         2.19.1   
setuptools       38.5.2   
six              1.11.0   
urllib3          1.23     
**websocket        0.2.1    
websocket-client 0.48.0**   
wheel            0.30.0  

I uninstalled websocket then installed websocket-client, with this result:

(3rdPartyInstagramApp) MacBook-Pro:~ forestdewberry$ sudo -H pip3 uninstall websocket
Uninstalling websocket-0.2.1:
  Would remove:
    /usr/local/lib/python3.6/site-packages/websocket-0.2.1.dist-info/*
    /usr/local/lib/python3.6/site-packages/websocket/*
Proceed (y/n)? y
  Successfully uninstalled websocket-0.2.1
(3rdPartyInstagramApp) MacBook-Pro:~ forestdewberry$ sudo -H pip3 install websocket-client
Requirement already satisfied: websocket-client in /usr/local/lib/python3.6/site-packages/websocket_client-0.48.0-py3.6.egg (0.48.0)
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from websocket-client) (1.11.0)
(3rdPartyInstagramApp) MacBook-Pro:~ forestdewberry$ sudo -H pip3 uninstall websocket-client
Uninstalling websocket-client-0.48.0:
  Would remove:
    /usr/local/lib/python3.6/site-packages/websocket_client-0.48.0-py3.6.egg
Proceed (y/n)? y
  Successfully uninstalled websocket-client-0.48.0
(3rdPartyInstagramApp) MacBook-Pro:~ forestdewberry$ sudo -H pip3 install websocket-client
Collecting websocket-client
  Downloading https://files.pythonhosted.org/packages/8a/a1/72ef9aa26cfe1a75cee09fc1957e4723add9de098c15719416a1ee89386b/websocket_client-0.48.0-py2.py3-none-any.whl (198kB)
    100% |████████████████████████████████| 204kB 1.4MB/s 
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from websocket-client) (1.11.0)
Installing collected packages: websocket-client
Successfully installed websocket-client-0.48.0
(3rdPartyInstagramApp) MacBook-Pro:~ forestdewberry$ python3
Python 3.6.4 (default, Mar  9 2018, 23:15:08) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyChromeDevTools
>>> chrome =  PyChromeDevTools.ChromeInterface()
>>> 

It works!

from pychromedevtools.

marty90 avatar marty90 commented on August 24, 2024

Perfect;)

from pychromedevtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.