alfred82santa / whalesong

Whalesong is an asyncio python library to manage WebApps remotely. Currently WhatsappWeb is implemented
https://whalesong.readthedocs.io
MIT License
50 stars 19 forks source link

No such file or directory - Windows #120

Closed kaiserdj closed 4 years ago

kaiserdj commented 4 years ago

Describe the bug I try to execute any example that is in the project and gives error (Windows)

Additional context monitor.loop.run_until_complete(monitor.start()) File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 579, in run_until_complete return future.result() File "c:/Users/gonfe/Desktop/whalesong-master/whalesong-master/examples/getcontacts.py", line 54, in start await self._driver.start() File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\__init__.py", line 96, in start await self._driver.connect() File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver_firefox.py", line 108, in connect await self.run_scriptlet() File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver.py", line 68, in run_scriptlet with open(Path(Path(__file__).parent, "js", "whalesong.js"), "r") as script: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\gonfe\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\whalesong\\js\\whalesong.js'

error.txt

kaiserdj commented 4 years ago

try with chromium

Microsoft Windows [Versión 10.0.18362.356]
(c) 2019 Microsoft Corporation. Todos los derechos reservados.

c:\Users\gonfe\Desktop\whalesong-master\whalesong-master>C:\Users\gonfe\AppData\Local\Programs\Python\Python37\python.exe c:\Users\gonfe\.vscode-insiders\extensions\ms-python.python-2019.10.37832-dev\pythonFiles\ptvsd_launcher.py --default --client --host localhost --port 52084 c:\Users\gonfe\Desktop\whalesong-master\whalesong-master\examples\getlivelocations-chromium.py
Task exception was never retrieved
future: <Task finished coro=<BaseWhalesongDriver.start_driver() done, defined at C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver.py:41> exception=BrowserError('Browser closed unexpectedly:\n[0926/223451.765:FATAL:content_main_runner_impl.cc(571)] --single-process is not supported in chrome multiple dll browser.\r\nBacktrace:\r\n\tovly_debug_event [0x00007FF800DEBFF4+13410676]\r\n\tovly_debug_event [0x00007FF800E04465+13510117]\r\n\tovly_debug_event [0x00007FF800DB3FD9+13181273]\r\n\tovly_debug_event [0x00007FF800DBE40E+13223310]\r\n\tovly_debug_event [0x00007FF800DB3849+13179337]\r\n\tIsSandboxedProcess [0x00007FF801393C6F+2188323]\r\n\tIsSandboxedProcess [0x00007FF801393CFB+2188463]\r\n\tovly_debug_event [0x00007FF800DBCD29+13217449]\r\n\tChromeMain [0x00007FF8001211A9+273]\r\n\tOrdinal0 [0x00007FF6D70331AC+12716]\r\n\tOrdinal0 [0x00007FF6D7031740+5952]\r\n\tGetHandleVerifier [0x00007FF6D7112262+654914]\r\n\tBaseThreadInitThunk [0x00007FF8752F7BD4+20]\r\n\tRtlUserThreadStart [0x00007FF87634CEE1+33]\r\n\r\n')>
Traceback (most recent call last):
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver.py", line 53, in start_driver
    await self._fut_start
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver_chromium.py", line 71, in _internal_start_driver
    **self.options)
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\pyppeteer\launcher.py", line 311, in launch
    return await Launcher(options, **kwargs).launch()
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\pyppeteer\launcher.py", line 189, in launch
    self.browserWSEndpoint = self._get_ws_endpoint()
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\pyppeteer\launcher.py", line 233, in _get_ws_endpoint
    self.proc.stdout.read().decode()
pyppeteer.errors.BrowserError: Browser closed unexpectedly:
[0926/223451.765:FATAL:content_main_runner_impl.cc(571)] --single-process is not supported in chrome multiple dll browser.
Backtrace:
        ovly_debug_event [0x00007FF800DEBFF4+13410676]
        ovly_debug_event [0x00007FF800E04465+13510117]
        ovly_debug_event [0x00007FF800DB3FD9+13181273]
        ovly_debug_event [0x00007FF800DBE40E+13223310]
        ovly_debug_event [0x00007FF800DB3849+13179337]
        IsSandboxedProcess [0x00007FF801393C6F+2188323]
        IsSandboxedProcess [0x00007FF801393CFB+2188463]
        ovly_debug_event [0x00007FF800DBCD29+13217449]
        ChromeMain [0x00007FF8001211A9+273]
        Ordinal0 [0x00007FF6D70331AC+12716]
        Ordinal0 [0x00007FF6D7031740+5952]
        GetHandleVerifier [0x00007FF6D7112262+654914]
        BaseThreadInitThunk [0x00007FF8752F7BD4+20]
        RtlUserThreadStart [0x00007FF87634CEE1+33]

Traceback (most recent call last):
  File "c:\Users\gonfe\.vscode-insiders\extensions\ms-python.python-2019.10.37832-dev\pythonFiles\ptvsd_launcher.py", line 43, in <module>
    main(ptvsdArgs)
  File "c:\Users\gonfe\.vscode-insiders\extensions\ms-python.python-2019.10.37832-dev\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 432, in main
    run()
  File "c:\Users\gonfe\.vscode-insiders\extensions\ms-python.python-2019.10.37832-dev\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 316, in run_file
    runpy.run_path(target, run_name='__main__')
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\gonfe\Desktop\whalesong-master\whalesong-master\examples\getlivelocations-chromium.py", line 110, in <module>
        Ordinal0 [0x00007FF6D70331AC+12716]
        Ordinal0 [0x00007FF6D7031740+5952]
        GetHandleVerifier [0x00007FF6D7112262+654914]
        BaseThreadInitThunk [0x00007FF8752F7BD4+20]
        RtlUserThreadStart [0x00007FF87634CEE1+33]
vasani-arpit commented 4 years ago

in windows chrome doesn't support --single-process flag. Please remove it and try again.

kaiserdj commented 4 years ago

Same error in chrome with remove --single-process flag

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: C:\Users\gonfe\Desktop\whalesong-master\whalesong-master\examples\minibot-chromium.py 
Traceback (most recent call last):
  File "C:\Users\gonfe\Desktop\whalesong-master\whalesong-master\examples\minibot-chromium.py", line 240, in <module>
    bot.loop.run_until_complete(bot.start())
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 579, in run_until_complete
    return future.result()
  File "C:\Users\gonfe\Desktop\whalesong-master\whalesong-master\examples\minibot-chromium.py", line 227, in start
    await self._driver.start()
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\__init__.py", line 96, in start
    await self._driver.connect()
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver_chromium.py", line 82, in connect
    await self.refresh()
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver_chromium.py", line 90, in refresh
    await self.run_scriptlet()
  File "C:\Users\gonfe\AppData\Local\Programs\Python\Python37\lib\site-packages\whalesong\driver.py", line 68, in run_scriptlet
    with open(Path(Path(__file__).parent, "js", "whalesong.js"), "r") as script:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\gonfe\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\whalesong\\js\\whalesong.js'
>>> 
vasani-arpit commented 4 years ago

You need to build the JS scriptlets folder. Have a look at makefile to know more about it.

Basically, It is missing the important js file which needs to be build before starting the python code.

It will be a lot of effort to put in if you are trying to get this working in windows. believe me I know. on top of that whatsapp updated it's web a day before yesterday. This repo is not up to that change yet. so even though you get it all working there will be things which will be left undone.

I suggest you to look at this repo. as the community support is good in there. But getting it up on windows is till a headache(at least for me).

so, I switched to node.