cli: produce correct HTML5 and fix JS query
This commit is contained in:
parent
3ecce46175
commit
5549ecbf24
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue