-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Attempting to capture example.com as advised ie running
python3 capture/capture.py http://example.com/ --output bench/example.rkt
results in a bench/example.rkt file looking like this for me:
;; From http://example.com/
(define-stylesheet
((tag body)
[background-color (rgb 240 240 242)]
[margin-top (px 0)]
[margin-right (px 0)]
[margin-bottom (px 0)]
[margin-left (px 0)]
[padding-top (px 0)]
[padding-right (px 0)]
[padding-bottom (px 0)]
[padding-left (px 0)]
[font-family "-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif"])
((tag div)
[width (px 600)]
[margin-top (em 5)]
[margin-right auto]
[margin-bottom (em 5)]
[margin-left auto]
[padding-top (em 2)]
[padding-right (em 2)]
[padding-bottom (em 2)]
[padding-left (em 2)]
[background-color (rgb 253 253 255)]
#;[border-top-left-radius (em 0.5)]
#;[border-top-right-radius (em 0.5)]
#;[border-bottom-right-radius (em 0.5)]
#;[border-bottom-left-radius (em 0.5)]
#;[box-shadow rgba(0, 0, 0, 0.02) 2px 3px 7px 2px])
((fake "a:link" (id e0001))
[color (rgb 56 72 143)]
#;[text-decoration-line none]
#;[text-decoration-style solid]
#;[text-decoration-color currentcolor]
#;[text-decoration-thickness auto])
((fake " a:visited")
[color (rgb 56 72 143)]
#;[text-decoration-line none]
#;[text-decoration-style solid]
#;[text-decoration-color currentcolor]
#;[text-decoration-thickness auto])
((media (max-width (px 700)) (tag div))
[margin-top (px 0)]
[margin-right auto]
[margin-bottom (px 0)]
[margin-left auto]
[width auto]))
(define-fonts
[16 "serif" 400 normal 13.5 2.5 1.5 1.5 19]
[16 "-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif" 400 normal 13.5 2.5 1.5 1.5 19]
[32 "-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif" 700 normal 27 5 3 3 38])
(define-browser
:matched true
:w 1280
:h 939
:fs 16
:fsm 12
:scrollw 12)
(define-document
([html :num 0]
([head :num 1]
([title :num 2])
([meta :num 3])
([meta :num 4])
([meta :num 5])
([style :num 6]))
([body :num 7]
([div :num 8]
([h1 :num 9] "Example Domain")
([p :num 10] "This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.")
([p :num 11]
([a :num 12 :id e0001] "More information..."))))))
(define-layout ( )
([VIEW :w 1280]
([BLOCK :x 0 :y 0 :w 1280 :h 6193/15 :elt 0]
([BLOCK :x 0 :y 80 :w 1280 :h 3793/15 :elt 7]
([BLOCK :x 308 :y 80 :w 664 :h 3793/15 :elt 8]
([BLOCK :x 340 :y 4003/30 :w 600 :h 38 :elt 9]
([LINE]
([TEXT :x 340 :y 4003/30 :w 301.4 :h 38 :text "Example Domain"])))
([BLOCK :x 340 :y 2893/15 :w 600 :h 57 :elt 10]
([LINE]
([TEXT :x 340 :y 2893/15 :w 592.4 :h 19 :text "This domain is for use in illustrative examples in documents. You may use " :br ]))
([LINE]
([TEXT :x 340 :y 3178/15 :w 511.3 :h 19 :text "this domain in literature without prior coordination or asking for " :br ]))
([LINE]
([TEXT :x 340 :y 3463/15 :w 1849/20 :h 19 :text "permission."])))
([BLOCK :x 340 :y 3988/15 :w 600 :h 19 :elt 11]
([LINE]
([INLINE :x 340 :y 3988/15 :w 9139/60 :h 19 :elt 12]
([TEXT :x 340 :y 3988/15 :w 9139/60 :h 19 :text "More information..."])))))))))
(define-problem
:title "Example Domain"
:url "http://example.com/"
:sheets firefox
:fonts
:layouts
:script
:features unknown-selector @media float:0)
ie. tokens after define-stylesheet, define-browser, etc. are all missing, resulting in error messages when attempting to run Cassius command line tools on it eg:
$ racket src/run.rkt accept bench/example.rkt doc-1
match: no matching clause for '(true :w 1280 :h 939 :fs 16 :fsm 12 :scrollw 12)
location...:
src/common.rkt:113:2
...
Manually editing the file and adding doc-1, firefox, fixing define-problem, etc. such that it reads
;;; From http://example.com/
(define-stylesheet doc-1
((tag body)
[background-color (rgb 240 240 242)]
[margin-top (px 0)]
[margin-right (px 0)]
[margin-bottom (px 0)]
[margin-left (px 0)]
[padding-top (px 0)]
[padding-right (px 0)]
[padding-bottom (px 0)]
[padding-left (px 0)]
[font-family "-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif"])
((tag div)
[width (px 600)]
[margin-top (em 5)]
[margin-right auto]
[margin-bottom (em 5)]
[margin-left auto]
[padding-top (em 2)]
[padding-right (em 2)]
[padding-bottom (em 2)]
[padding-left (em 2)]
[background-color (rgb 253 253 255)]
#;[border-top-left-radius (em 0.5)]
#;[border-top-right-radius (em 0.5)]
#;[border-bottom-right-radius (em 0.5)]
#;[border-bottom-left-radius (em 0.5)]
#;[box-shadow rgba(0, 0, 0, 0.02) 2px 3px 7px 2px])
((fake "a:link" (id e0001))
[color (rgb 56 72 143)]
#;[text-decoration-line none]
#;[text-decoration-style solid]
#;[text-decoration-color currentcolor]
#;[text-decoration-thickness auto])
((fake " a:visited")
[color (rgb 56 72 143)]
#;[text-decoration-line none]
#;[text-decoration-style solid]
#;[text-decoration-color currentcolor]
#;[text-decoration-thickness auto])
((media (max-width (px 700)) (tag div))
[margin-top (px 0)]
[margin-right auto]
[margin-bottom (px 0)]
[margin-left auto]
[width auto]))
(define-fonts doc-1
[16 "serif" 400 normal 13.5 2.5 1.5 1.5 19]
[16 "-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif" 400 normal 13.5 2.5 1.5 1.5 19]
[32 "-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif" 700 normal 27 5 3 3 38])
(define-browser firefox
:matched true
:w 1280
:h 939
:fs 16
:fsm 12
:scrollw 12)
(define-document doc-1
([html :num 0]
([head :num 1]
([title :num 2])
([meta :num 3])
([meta :num 4])
([meta :num 5])
([style :num 6]))
([body :num 7]
([div :num 8]
([h1 :num 9] "Example Domain")
([p :num 10] "This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.")
([p :num 11]
([a :num 12 :id e0001] "More information..."))))))
(define-layout doc-1 (firefox doc-1)
([VIEW :w 1280]
([BLOCK :x 0 :y 0 :w 1280 :h 6193/15 :elt 0]
([BLOCK :x 0 :y 80 :w 1280 :h 3793/15 :elt 7]
([BLOCK :x 308 :y 80 :w 664 :h 3793/15 :elt 8]
([BLOCK :x 340 :y 4003/30 :w 600 :h 38 :elt 9]
([LINE]
([TEXT :x 340 :y 4003/30 :w 301.4 :h 38 :text "Example Domain"])))
([BLOCK :x 340 :y 2893/15 :w 600 :h 57 :elt 10]
([LINE]
([TEXT :x 340 :y 2893/15 :w 592.4 :h 19 :text "This domain is for use in illustrative examples in documents. You may use " :br ]))
([LINE]
([TEXT :x 340 :y 3178/15 :w 511.3 :h 19 :text "this domain in literature without prior coordination or asking for " :br ]))
([LINE]
([TEXT :x 340 :y 3463/15 :w 1849/20 :h 19 :text "permission."])))
([BLOCK :x 340 :y 3988/15 :w 600 :h 19 :elt 11]
([LINE]
([INLINE :x 340 :y 3988/15 :w 9139/60 :h 19 :elt 12]
([TEXT :x 340 :y 3988/15 :w 9139/60 :h 19 :text "More information..."])))))))))
(define-problem doc-1
:title "Example Domain"
:url "http://example.com/"
:sheets doc-1
:fonts doc-1
:documents doc-1
:layouts doc-1
:features unknown-selector @media float:0)
will result in a succesfull (albeit rejected) accept run:
$ racket src/run.rkt accept bench/example-repaired.rkt doc-1
[ 0.000s] Read 1 documents with 13 elements, 18 boxes, 5 rules, and 3 fonts
[ 0.126s] Produced 1443 constraints of 22880 terms
[ 1.895s] Prepared 4005 constraints of 82351 terms
[ 0.542s] Found core with 1 constraints
([VIEW :w 1280]
([BLOCK :x 0 :y 0 :w 1280 :h 6193/15 :elt 0]
([BLOCK :x 0 :y 80 :w 1280 :h 3793/15 :elt 7]
([BLOCK :x 308 :y 80 :w 664 :h 3793/15 :elt 8]
([BLOCK :x 340 :y 4003/30 :w 600 :h 38 :elt 9]
([LINE]
([TEXT :x 340 :y 4003/30 :w 1507/5 :h 38])))
([BLOCK :x 340 :y 2893/15 :w 600 :h 57 :elt 10]
([LINE]
([TEXT :x 340 :y 2893/15 :w 2962/5 :h 19]))
([LINE]
([TEXT :x 340 :y 3178/15 :w 5113/10 :h 19]))
([LINE]
([TEXT :x 340 :y 3463/15 :w 1849/20 :h 19])))
([BLOCK :x 340 :y 3988/15 :w 600 :h 19 :elt 11]
([LINE]
([INLINE :x 340 :y 3988/15 :w 9139/60 :h 19 :elt 12]
([TEXT :x 340 :y 3988/15 :w 9139/60 :h 19]))))))))
Rejected.
Ubuntu version 20.04.4
Firefox version 103 (for Canonical)
geckodriver version 0.31.0
Python version 3.8.10
Selenium version 4.0.0a1
Racket version 7.2
Greets
Metadata
Metadata
Assignees
Labels
No labels