dafthack / PowerWebShot

A PowerShell tool for taking screenshots of multiple web servers quickly.
MIT License
90 stars 37 forks source link

Screenshots failing for me #3

Open snappyq opened 7 years ago

snappyq commented 7 years ago

Downloaded the zip, followed the instructions, and received the following error. The report.html file is generated, but no screenshot. Not sure what I'm missing. Both the exe & dll are in the same directory. End-user error?

PS C:\Users\user\Desktop\PowerWebShot> Invoke-PowerWebShot -URL http://www.google.com New-Object : Exception calling ".ctor" with "2" argument(s): "The file .\PhantomJS.exe does not exist. The driver can be downloaded at http://phantomjs.org/download.html" At C:\Users\user\Desktop\PowerWebShot\PowerWebShot.ps1:93 char:11

The property 'Url' cannot be found on this object. Verify that the property exists and can be set. At C:\Users\user\Desktop\PowerWebShot\PowerWebShot.ps1:96 char:1

[*] The output directory 2017-07-11-125101 does not exist. Creating directory 2017-07-11-125101.

Directory: C:\Users\user\Desktop\PowerWebShot

Mode LastWriteTime Length Name


d----- 7/11/2017 12:51 PM 2017-07-11-125101
The property 'Url' cannot be found on this object. Verify that the property exists and can be set. At C:\Users\user\Desktop\PowerWebShot\PowerWebShot.ps1:169 char:9

You cannot call a method on a null-valued expression. At C:\Users\user\Desktop\PowerWebShot\PowerWebShot.ps1:170 char:9

You cannot call a method on a null-valued expression. At C:\Users\user\Desktop\PowerWebShot\PowerWebShot.ps1:178 char:9

You cannot call a method on a null-valued expression. At C:\Users\user\Desktop\PowerWebShot\PowerWebShot.ps1:185 char:9

You cannot call a method on a null-valued expression. At C:\Users\user\Desktop\PowerWebShot\PowerWebShot.ps1:273 char:1

PS C:\Users\user\Desktop\PowerWebShot>

rrngithub commented 6 years ago

Having same issue - Anyone manage to resolve.

aperiooculus commented 6 years ago

When I received this error the script was looking for the files in the path C:\Windows\system32.

To fix this I

  1. setup the script and it's files as a module by copy the repo to C:\Program Files\WindowsPowerShell\Modules\.
  2. Then, I edited the PowerWebShot.ps1 script to look for the WebDriver.dll file at C:\Program Files\WindowsPowerShell\Modules\PowerWebShot\WebDriver.dll (line 80) and
  3. I modified the $phantomjspath to be C:\Program Files\WindowsPowerShell\Modules\PowerWebShot (line 92).
AlexUhde commented 5 years ago

Hello, If you have Powershell 3 or newer, you can do the following changes: line 80: $SeleniumDriverPath = "$PSScriptRoot\WebDriver.dll" line 92: $phantomjspath = $PSScriptRoot

That has fixed the issue for me.

barrett092 commented 2 years ago

Neither of these methods work for me. Not sure what I'm doing wrong.