Skip to content

[Feature] Support executing playwright code (--eval) #178

@quidnu

Description

@quidnu

javascript is a useful function but lacks many of the niceties provided by playwright. It would be nice to be able to make use of playwright by providing an eval-unsafe (or playwright?) subcommand that evaluates playwright code in the scope of the "page" variable.

This feature would also make it much easier to run simple one-off playwright scripts without all of the package/project management and page setup boilerplate code. e.g. shot-scraper --eval-unsafe 'page.querySelector('a').getAttribute('href').

Obviously 'eval' is in general a security risk but shouldn't be a problem in the context of non-server facing code (which is a minority use case in shot-scraper?). It should be explicitly labeled as unsafe: e.g. --eval-unsafe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions