niklasb / dryscrape

[not actively maintained] A lightweight Python library that uses Webkit to enable easy scraping of dynamic, Javascript-heavy web pages
http://dryscrape.readthedocs.io/
MIT License
533 stars 67 forks source link

Unable to find QtWebKit on MacOS Darwin #79

Open antani opened 7 years ago

antani commented 7 years ago

I am not able to run a piece of code which was working perfectly a few days back -
System Software Overview: System Version: OS X 10.11.6 (15G31) Kernel Version: Darwin 15.6.0 ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G31

→ brew info qt
  qt: stable 5.9.0 (bottled), HEAD [keg-only]
 Cross-platform application and UI framework
 https://www.qt.io/
/usr/local/Cellar/qt/5.9.0 (9,015 files, 297.7MB)
Poured from bottle on 2017-06-09 at 19:48:25
 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/qt.rb
 ... This formula is keg-only, which means it was not symlinked into /usr/local,
 because Qt 5 has CMake issues when linked. 
 If you need to have this software first in your PATH run:
 echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc

... Actual error:

File "high_volume.py", line 103, in get_markets
session = dryscrape.Session()
File "/Users/8288/source_code/finance/venv/lib/python2.7/site-packages/dryscrape/session.py", line 22, in __init__
self.driver = driver or DefaultDriver()
File "/Users/8288/source_code/finance/venv/lib/python2.7/site-packages/dryscrape/driver/webkit.py", line 30, in __init__
super(Driver, self).__init__(**kw)
File "/Users/8288/source_code/finance/venv/lib/python2.7/site-packages/webkit_server.py", line 230, in __init__
self.conn = connection or ServerConnection()
File "/Users/8288/source_code/finance/venv/lib/python2.7/site-packages/webkit_server.py", line 507, in __init__
self._sock = (server or get_default_server()).connect()
File "/Users/8288/source_code/finance/venv/lib/python2.7/site-packages/webkit_server.py", line 450, in get_default_server
_default_server = Server()
File "/Users/8288/source_code/finance/venv/lib/python2.7/site-packages/webkit_server.py", line 427, in __init__
raise WebkitServerError("webkit-server failed to start. Output:\n" + err)
webkit_server.WebkitServerError: webkit-server failed to start. Output:
dyld: Library not loaded: /usr/local/opt/qt/lib/QtWebKit.framework/Versions/4/QtWebKit
Referenced from: /Users/8288/source_code/finance/venv/lib/python2.7/site-packages/webkit_server
Reason: image not found
kunrenzhilu commented 6 years ago

He said we should use qt < 5.5.. But I have qt 5.10, and seeing you are using 5.9 Do you have any workaround?