maaaaz / webscreenshot

A simple script to screenshot a list of websites
GNU Lesser General Public License v3.0
656 stars 162 forks source link

Issue with PATH env #21

Closed albertzsigovits closed 5 years ago

albertzsigovits commented 5 years ago

Got some issue with the PATH env. I'm trying to make it work under Win7.

set PHANTOMJS_BIN="C:\Program Files\phantomjs"

[WinError 2] The system cannot find the file specified [ERROR][http://abc.xyz:80] renderer binary could not have been found in your current PATH environment variable, exiting

Tried with explicitly adding -r phantomjs, or chrome, chromium, none of them work.

maaaaz commented 5 years ago

Hello @albertzsigovits,

  1. Is your phantomjs binary in the PATH variable, such as described here ?
  2. Alternatively can you try to use the --renderer-binary option by specifying the absolute path to your phantomjs binary ?

Best regards

albertzsigovits commented 5 years ago

Input: $ python webscreenshot.py -i web.txt -o web\ -r phantomjs --renderer-binary E:\screen\phantomjs\bin\phantomjs.exe -v

Output: [INFO][General] 'www.xyz' has been formatted as 'http://www.xyz:80' with supplied overriding options [+] 1 URLs to be screenshot [WinError 2] The system cannot find the file specified [ERROR][http://www.xyz:80] renderer binary could not have been found in your current PATH environment variable, exiting

Why is it still trying to look for a PATH variable when --renderer-binary should take precedence?

maaaaz commented 5 years ago

It is now normaly fixed in https://github.com/maaaaz/webscreenshot/commit/2fe998656c14ef6fb0e5f46ce3dbfafa925f51b6, just make a pip install --upgrade webscreenshot

There were some issues in the way shlex splits Windows paths.

The --renderer-binary option, when specified, always take precedence over PATH.

Cheers.

albertzsigovits commented 5 years ago

You rock! Works now.

ghost commented 5 years ago

how can this be done on mac? im having the same problem

jindri-ch commented 4 years ago

For macos use this.

brew tap homebrew/cask brew cask install phantomjs