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
de1a0348
...
de1a0348bcf5b63021914958e8f1fbded16a6908
authored
2011-10-10 18:06:09 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed error on Casper#captureSelector and Casper#fill
1 parent
ad4f403f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
casper.js
samples/googlelinks.js
casper.js
View file @
de1a034
...
...
@@ -130,7 +130,7 @@
* @return Casper
*/
captureSelector
:
function
(
targetFile
,
selector
)
{
return
this
.
capture
(
targetFile
,
self
.
evaluate
(
function
()
{
return
this
.
capture
(
targetFile
,
this
.
evaluate
(
function
()
{
try
{
return
document
.
querySelector
(
selector
).
getBoundingClientRect
();
}
catch
(
e
)
{
...
...
@@ -332,7 +332,7 @@
}
// Form submission?
if
(
submit
===
true
)
{
self
.
evaluate
(
function
()
{
this
.
evaluate
(
function
()
{
var
form
=
document
.
querySelector
(
'%selector%'
);
console
.
log
(
'submitting form to '
+
(
form
.
getAttribute
(
'action'
)
||
"unknown"
)
+
', HTTP '
+
(
form
.
getAttribute
(
'method'
).
toUpperCase
()
||
"GET"
));
...
...
samples/googlelinks.js
View file @
de1a034
...
...
@@ -12,7 +12,8 @@ function getLinks() {
var
links
=
[];
var
casper
=
new
phantom
.
Casper
({
logLevel
:
"info"
,
// we only want "info" or higher level log messages
faultTolerant
:
false
,
logLevel
:
"debug"
,
// we only want "info" or higher level log messages
loadImages
:
false
,
// do not download images to save bandwidth
loadPlugins
:
false
,
// do not load plugins to save kitten
verbose
:
true
// write log messages to the console
...
...
Please
register
or
sign in
to post a comment