I am currently looking into this issue. Bear with me as it's my first contribution to a Node project āØ
Investigation
Without setting a file name everything seems to work as expected. Separate files get saved as facebook.com-1366x768.png
and google.com-1366x768.png
.
ā pageres-cli git:(master) ā node cli.js [ http://google.com ] [ http://facebook.com ]
http://google.com [ '1366x768' ] {
verbose: false,
v: false,
crop: false,
c: false,
overwrite: false,
delay: 0,
d: 0,
scale: 1,
cookies: undefined,
headers: undefined
}
http://facebook.com [ '1366x768' ] {
verbose: false,
v: false,
crop: false,
c: false,
overwrite: false,
delay: 0,
d: 0,
scale: 1,
cookies: undefined,
headers: undefined
}
ā Generated 2 screenshots from 2 urls and 1 size
The problem here is that both URLs will receive the same file name filename: [ 'goo', 'face' ]
and it will end up as goo,face.png
, which might be a screenshot of Facebook or Google.
ā pageres-cli git:(master) ā node cli.js [ http://google.com --filename='goo' ] [ http://facebook.com --filename='face' ]
http://google.com [ '1366x768' ] {
verbose: false,
v: false,
crop: false,
c: false,
overwrite: false,
filename: [ 'goo', 'face' ],
delay: 0,
d: 0,
scale: 1,
cookies: undefined,
headers: undefined
}
http://facebook.com [ '1366x768' ] {
verbose: false,
v: false,
crop: false,
c: false,
overwrite: false,
filename: [ 'goo', 'face' ],
delay: 0,
d: 0,
scale: 1,
cookies: undefined,
headers: undefined
}
ā Generated 2 screenshots from 2 urls and 1 size