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

Add support for webkit #56

Merged
merged 2 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -211,6 +211,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 @@ -68,6 +68,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