Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
0cb6c2bb
...
0cb6c2bb84c44480bffea3e867d39125399c9221
authored
2012-01-17 10:13:19 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
typos
1 parent
3792ff6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
samples/bbcshots.coffee
samples/bbcshots.coffee
View file @
0cb6c2b
...
...
@@ -27,7 +27,7 @@ casper.start 'http://www.bbc.co.uk/', ->
# Building resulting page and image
buildPage
=
->
this
.
echo
'Build result page'
@
echo
'Build result page'
fs
=
require
'fs'
@
viewport
624
,
400
pageHtml
=
"<html bgcolor=black><body>"
...
...
@@ -36,8 +36,8 @@ buildPage = ->
pageHtml
+=
"</body></html>"
fs
.
write
'result.html'
,
pageHtml
,
'w'
@
thenOpen
"file://
#{
fs
.
workingDirectory
}
/result.html"
,
->
this
.
echo
'Resulting image saved to result.png'
this
.
capture
'result.png'
@
echo
'Resulting image saved to result.png'
@
capture
'result.png'
# Capture carrousel area
next
=
->
...
...
@@ -48,10 +48,10 @@ next = ->
if
currentLink
<
nbLinks
@
click
".carousel_itemList_li[rel='
#{
currentLink
}
']"
@
wait
1000
,
->
this
.
then
next
@
then
next
currentLink
++
else
this
.
then
buildPage
@
then
buildPage
casper
.
then
next
...
...
Please
register
or
sign in
to post a comment