diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-01-17 17:27:43 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-01-17 17:27:43 +0200 |
commit | b6210b2dd20d4bfe5d4a2c14aa2b075ea7d4c312 (patch) | |
tree | e09d3f372d29cd1ff57ba9fad41604100a20a935 /my-sites.py | |
download | my-sites-b6210b2dd20d4bfe5d4a2c14aa2b075ea7d4c312.tar.gz |
initial version
Diffstat (limited to 'my-sites.py')
-rw-r--r-- | my-sites.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/my-sites.py b/my-sites.py new file mode 100644 index 0000000..f01eea9 --- /dev/null +++ b/my-sites.py @@ -0,0 +1,11 @@ +import requests + +def fetch(ctx, url=None): + r = requests.get(url) + assert r.ok + ctx["page"] = r.text + +def contains(ctx, text=None): + if text not in ctx["page"]: + print(f"page does not contain {text!r}") + assert 0 |