summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2020-10-29 10:29:23 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2020-10-29 10:29:23 (GMT)
commit5549ecbf2453ad881ddab1812ff92978f39735cf (patch)
tree02078e99d47bfa522351e26749828edcbcc1fa56
parent3ecce46175bc5c9e7181550006d7e6a0e97da9ab (diff)
downloadeopayment-5549ecbf2453ad881ddab1812ff92978f39735cf.zip
eopayment-5549ecbf2453ad881ddab1812ff92978f39735cf.tar.gz
eopayment-5549ecbf2453ad881ddab1812ff92978f39735cf.tar.bz2
cli: produce correct HTML5 and fix JS query
-rw-r--r--eopayment/__main__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/eopayment/__main__.py b/eopayment/__main__.py
index 71fd4ea..06e72ba 100644
--- a/eopayment/__main__.py
+++ b/eopayment/__main__.py
@@ -99,9 +99,11 @@ def request(backend, amount, param):
if kind == FORM:
print(what)
with tempfile.NamedTemporaryFile(mode='w', delete=False) as fd:
+ print('<!doctype html> <html> <head> <meta charset="utf-8"> </head> <body>', file=fd)
print(what, file=fd)
- print('''<script>document.getElementsByName('Submit')[0].click()</script>''', file=fd)
+ print('''<script>document.querySelector('input[type="submit"]').click()</script>''', file=fd)
subprocess.call(['gnome-www-browser', fd.name])
+ print('</body> <html>', file=fd)
elif kind == URL:
print('Please click on URL:', what)
subprocess.call(['gnome-www-browser', what])