Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning data from target page #44

Open
wrabit opened this issue Jun 21, 2017 · 3 comments
Open

Returning data from target page #44

wrabit opened this issue Jun 21, 2017 · 3 comments

Comments

@wrabit
Copy link

wrabit commented Jun 21, 2017

In CasperJS I would write something like:

    title = this.evaluate(function() {
        return $.trim($('.title').text());
    });

How can I achieve the same with this wrapper?

@davidgv88
Copy link

+1!

@davidgv88
Copy link

Created Pull Request #51

@davidgv88
Copy link

davidgv88 commented Oct 11, 2017

Whit this Pull Request you can do this:

$casper = new Casper();
$casper->start('http://example.com');
$casper->evaluateToVar('title','return $.trim($('.title').text());');
$casper->run();

$vars = $casper->getVars();
echo $vars['title'];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants