Skip to content

Commit

Permalink
Add support for webkit (#56)
Browse files Browse the repository at this point in the history
Thanks, @rdmurphy
  • Loading branch information
rdmurphy authored Apr 11, 2022
1 parent 345e488 commit 0b0b3c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shot_scraper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from shot_scraper.utils import filename_for_url, url_or_file_path

BROWSERS = ("chromium", "firefox", "chrome", "chrome-beta")
BROWSERS = ("chromium", "firefox", "webkit", "chrome", "chrome-beta")


def browser_option(fn):
Expand Down Expand Up @@ -234,6 +234,8 @@ def _browser_context(
browser_obj = p.chromium.launch(**browser_kwargs)
elif browser == "firefox":
browser_obj = p.firefox.launch(**browser_kwargs)
elif browser == "webkit":
browser_obj = p.webkit.launch(**browser_kwargs)
else:
browser_kwargs["channel"] = browser
browser_obj = p.chromium.launch(**browser_kwargs)
Expand Down
2 changes: 2 additions & 0 deletions tests/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ shot-scraper 'https://www.whatismybrowser.com/detect/what-is-my-user-agent/' \
-o /tmp/whatismybrowser-default-chromium.png -h 400 -w 800
shot-scraper 'https://www.whatismybrowser.com/detect/what-is-my-user-agent/' \
-o /tmp/whatismybrowser-firefox.png -h 400 -w 800 -b firefox
shot-scraper 'https://www.whatismybrowser.com/detect/what-is-my-user-agent/' \
-o /tmp/whatismybrowser-webkit.png -h 400 -w 800 -b webkit
# And using multi
echo '# empty file' > empty.yml
shot-scraper multi empty.yml
Expand Down

0 comments on commit 0b0b3c7

Please sign in to comment.