htmlq icon indicating copy to clipboard operation
htmlq copied to clipboard

htmlq does not work with cron

Open MarioShatterhand opened this issue 4 years ago • 1 comments

Hello. I have found a bug that happens when I try to use HTMLq with curl in cron job. Same script that works well when run from console, in cron job returns nothing. Empty text. How to reproduce: in python:

import subprocess

command = 'curl --silent https://pwsztar.edu.pl/instytut-politechniczny/informatyka/harmonogramy/ | htmlq "#rozmCZ > p:nth-child(8)"'

ret = subprocess.run(command, capture_output=True, shell=True)
print(ret.stdout.decode('UTF-8'))

in bash script:

#!/bin/bash

variable=$(curl --silent https://pwsztar.edu.pl/instytut-politechniczny/informatyka/harmonogramy/ | htmlq "#rozmCZ > p:nth-child(8)")

echo "$variable"

MarioShatterhand avatar Sep 24 '21 12:09 MarioShatterhand

Does the cronhob have htmlq in PATH? Usually you use the full paths in cron. Get the full path of htmlq by running command -v htmlq

pbsds avatar Aug 19 '22 13:08 pbsds