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

shot-scraper multi --har, --har-zip, --har-file options #168

Merged
merged 4 commits into from
Feb 13, 2025
Merged

Conversation

simonw
Copy link
Owner

@simonw simonw commented Feb 13, 2025

Refs:

TODO:

  • Make output: YAML key optional to record page with no screenshot
  • Tests
  • Docs

📚 Documentation preview 📚: https://shot-scraper--168.org.readthedocs.build/en/168/

@simonw simonw added the enhancement New feature or request label Feb 13, 2025
@simonw
Copy link
Owner Author

simonw commented Feb 13, 2025

Tested like this:

shot-scraper multi har-only.yaml --har-file /tmp/multi.har.zip

Where har-only.yaml is:

- url: https://simonwillison.net/
- url: https://datasette.io/

Command output:

Skipping screenshot of 'https://simonwillison.net/'
Skipping screenshot of 'https://datasette.io/'
Wrote to HAR file: /tmp/multi.har.zip

And:

unzip -l /tmp/multi.har.zip
Archive:  /tmp/multi.har.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
    94353  02-13-2025 11:53   17d6ae78dbf2f5ea3d8441a56dbaa2dac759a6ff.html
    24161  02-13-2025 11:53   8fa48ad7be7e06fb912f0bec1f1dae5018db2dfd.css
   126852  02-13-2025 11:53   f62a2656783e9e6c3ed84dd4a5db6615c34f358c.jpeg
    64071  02-13-2025 11:53   b57847211c5bbfdb4f399137f7e893361c68d9aa.jpeg
     1393  02-13-2025 11:53   25c68a82b654c9d844c604565dab4785161ef697.js
   154648  02-13-2025 11:53   5c59480b9f44fc87f41c2b515ed225d858572089.jpeg
    85205  02-13-2025 11:53   16b5ba0e31e6fede6e7036d4338d85c535e21a91.jpeg
   145696  02-13-2025 11:53   da295c896d0d0871641b6d9935d5784e899c6210.jpeg
   307000  02-13-2025 11:53   0630922d73f6beaaa7818b136d3607fa729785f1.gif
    77388  02-13-2025 11:53   52d96f34cb0b1fe66ba473de81646a404663b28b.jpeg
     3289  02-13-2025 11:53   90583e29bd5d34260e825881f851b857a3ea17be.svg
     1458  02-13-2025 11:53   88e23080a0f2ca28c75e4a6458379a7ea095b5af.svg
   109072  02-13-2025 11:53   25b93d8900b10122558bd1caca5687c3743efa4f.jpeg
   124086  02-13-2025 11:53   96cc40f04f78856fa792eaa141051bf287322f92.jpeg
     1809  02-13-2025 11:53   0fd415711539e0b32f55e30e99ad706fe473ca56.svg
   128082  02-13-2025 11:53   9e670fcba946a32878cfaf547143ac2de12cfe28.gif
    95113  02-13-2025 11:53   725310ccf69980cbf8ea329960e4338c23876fd6.jpeg
    91201  02-13-2025 11:53   47bd4aaad9fa083dcd9cf7ecfaf729b7dafa5482.jpeg
    39067  02-13-2025 11:53   41824dbd0c51f584faf0e2c4e88de01b8a5dcdcd.html
     4052  02-13-2025 11:53   34972651f161f0396c697c65ef9aaeb2c9ac50c4.css
     2501  02-13-2025 11:53   9f612e71165058f0046d8bf8fec12af7eb15f39d.css
     5557  02-13-2025 11:53   427504aa6ef5a8786f90fb2de636133b3fc6d1fe.js
    10916  02-13-2025 11:53   2737174596eafba6e249022203c324605f023cdd.svg
     1158  02-13-2025 11:53   db4251165ed9e12f8b62bb34f31d057c9b6e5695.svg
     1161  02-13-2025 11:53   ec8282b36a166d63fae4c04166bb81f945660435.svg
     1170  02-13-2025 11:53   31c073551ef5c84324073edfc7b118f81ce9a7d2.svg
     1134  02-13-2025 11:53   3b9d8109b919dfe9393dab2376fe03267dadc1f1.svg
     3373  02-13-2025 11:53   5f85a11ef89c0e3f237c8e926c1cb66727182102.svg
    31670  02-13-2025 11:53   469f0d28af6c026dcae8c81731e2b0484aeac92c.jpeg
     1157  02-13-2025 11:53   b7786336bfce38a9677d26dc9ef468bb1ed45e19.svg
   124558  02-13-2025 11:53   har.har
---------                     -------
  1862351                     31 files

The --har option and --har-zip option work too.

@simonw
Copy link
Owner Author

simonw commented Feb 13, 2025

@simonw simonw merged commit 7531c0f into main Feb 13, 2025
11 checks passed
@simonw simonw deleted the multi-har branch February 13, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant