added documentation for Casper#getCurrentUrl()
Showing
1 changed file
with
15 additions
and
0 deletions
... | @@ -152,6 +152,7 @@ faultTolerant | Boolean | true | Catch and log exceptions when executing | ... | @@ -152,6 +152,7 @@ faultTolerant | Boolean | true | Catch and log exceptions when executing |
152 | logLevel | String | "error" | Logging level (see logLevels for available values) | 152 | logLevel | String | "error" | Logging level (see logLevels for available values) |
153 | onDie | function | null | A function to be called when Casper#die() is called | 153 | onDie | function | null | A function to be called when Casper#die() is called |
154 | onError | function | null | A function to be called when an "error" level event occurs | 154 | onError | function | null | A function to be called when an "error" level event occurs |
155 | onLoadError | function | null | A function to be called when a requested resource cannot be loaded | ||
155 | onPageInitialized | function | null | A function to be called after WebPage instance has been initialized | 156 | onPageInitialized | function | null | A function to be called after WebPage instance has been initialized |
156 | page | WebPage | null | An existing WebPage instance | 157 | page | WebPage | null | An existing WebPage instance |
157 | pageSettings | Object | {} | PhantomJS's WebPage settings object | 158 | pageSettings | Object | {} | PhantomJS's WebPage settings object |
... | @@ -410,6 +411,20 @@ casper.start('http://some.tld/contact.form', function(self) { | ... | @@ -410,6 +411,20 @@ casper.start('http://some.tld/contact.form', function(self) { |
410 | 411 | ||
411 | **WARNING:** Please don't use CasperJS nor PhantomJS to send spam, or I'll be calling the Chuck. More seriously, please don't. | 412 | **WARNING:** Please don't use CasperJS nor PhantomJS to send spam, or I'll be calling the Chuck. More seriously, please don't. |
412 | 413 | ||
414 | ### Casper#getCurrentUrl() | ||
415 | |||
416 | Retrieves current URL of current document. Note: the url will be url-decoded. | ||
417 | |||
418 | Example: | ||
419 | |||
420 | ``` javascript | ||
421 | casper.start('http://www.google.fr/', function(self) { | ||
422 | self.log(self.getCurrentUrl()); // "http://www.google.fr/" | ||
423 | }).run(function(self) { | ||
424 | self.exit(); | ||
425 | }); | ||
426 | ``` | ||
427 | |||
413 | ### Casper#repeat(int times, function then) | 428 | ### Casper#repeat(int times, function then) |
414 | 429 | ||
415 | Repeats a navigation step a given number of times. | 430 | Repeats a navigation step a given number of times. | ... | ... |
-
Please register or sign in to post a comment