2013-10-23 78 views
4

我在这里跟着指示:我的PhantomJS远程调试尝试有什么问题?

https://github.com/ariya/phantomjs/wiki/Troubleshooting

我也看到了所以在这里:

Getting remote debugging set up with PhantomJS

但我不能为我的生命得到远程调试与PhantomJS一起工作。以下是我已经试过:

[ubuntu:phantom]$ phantomjs --version 
1.9.1 
[ubuntu:phantom]$ phantomjs --remote-debugger-port=9001 test.js & 
[1] 14037 
[ubuntu:phantom]$ sudo netstat -pntl 
Active Internet connections (only servers) 
Proto Recv-Q Send-Q Local Address   Foreign Address   State  PID/Program name 
tcp  0  0 0.0.0.0:9418   0.0.0.0:*    LISTEN  1075/git-daemon 
tcp  0  0 127.0.0.1:5038   0.0.0.0:*    LISTEN  1466/asterisk 
tcp  0  0 0.0.0.0:80    0.0.0.0:*    LISTEN  1629/apache2  
tcp  0  0 0.0.0.0:2000   0.0.0.0:*    LISTEN  1466/asterisk 
tcp  0  0 127.0.0.1:53   0.0.0.0:*    LISTEN  1089/dnsmasq  
tcp  0  0 127.0.0.1:631   0.0.0.0:*    LISTEN  968/cupsd  
tcp  0  0 127.0.0.1:5984   0.0.0.0:*    LISTEN  1363/beam.smp 
tcp6  0  0 :::9418     :::*     LISTEN  1075/git-daemon 
tcp6  0  0 ::1:631     :::*     LISTEN  968/cupsd  
[ubuntu:phantom]$ google-chrome localhost:9001 
Created new window in existing browser session. 
[ubuntu:phantom]$ 
[ubuntu:phantom]$ nc localhost 9001 

以上(不出所料)打开Chrome浏览器与Oops! Google Chrome could not connect to localhost:9001。我不应该在9001上看到一个开放的端口吗?从我可以收集的内容来看,Chrome应该连接到一个(可能)空白页面,我只需在JS控制台上运行__run()即可。但就目前而言,没有任何东西可以打开......我甚至不能对它进行净化。

+0

您是否找到解决此问题的解决方案?我很喜欢同样的 – Joakim

+0

我得到了完全相同的结果,但是在Windows 10中使用PJS 2.1.1 - netstat -abno不会在指定端口上收听任何内容 –

回答

0

运行phantomjs,因为sudo似乎有窍门