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

added playwright support and passed the tests #1376

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

arulmabr
Copy link
Contributor

@arulmabr arulmabr commented Dec 10, 2024

You can install this by either:
poetry install --extras "screenshot"

or

pip install -e ".[screenshot]"


You run this by:

from edsl import FileStore
fs = FileStore.from_url_screenshot("https://www.expectedparrot.com")
fs.view()

I was not sure whether I should commit the poetry.lock file, please feel free to ignore that file.

@johnjosephhorton
Copy link
Contributor

Nice! Want to create a NB illustrating some examples?

@johnjosephhorton
Copy link
Contributor

one question - suppose a person installs without screenshots - is there an appropriate pip command they can use later to install or do they just re-install generally? It would be nice if when a user tries to use, say, screenshot, we say "Oh, to use this, run..."

@arulmabr
Copy link
Contributor Author

Creating a notebook,

So when they use screenshots without the dependencies the error will prompt them to run "pip install edsl[screenshot]"

@johnjosephhorton
Copy link
Contributor

Nice!
Two thoughts:

  1. You might have trouble with the NB version because of how Jupyter uses the even loop. You might need a decorator / detector. See the "JobRunnerAsyncIO" implementation. LMK if you run into trouble.
  2. It would be good to create a ScenarioList method that can take a list of URLs and get screenshots of each, returning a ScenarioList of file-store objects. This will be IO-bound should be done with aysync rather than just calling the methods sequentially, so maybe the scenario object exposes an async version.

@arulmabr
Copy link
Contributor Author

I'm using VScode's Notebook mode, resolved all the errors there. Let me try in Jupyter to see if things are breaking. Did you find any issues while running this brach yet?

Cool, will check out ScenarioList.

Also it just incurred that the pip install edsl[screenshot] method is just to keep the EDSL size lean. We can even run some post install scripts to make sure playwright is installed properly. This way base package size will be bigger but better UX. I'm not an expert on this yet, just checking with Claude.

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

Successfully merging this pull request may close these issues.

3 participants