Skip to content

htmlq does not work with cron #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MarioShatterhand opened this issue Sep 24, 2021 · 1 comment
Open

htmlq does not work with cron #25

MarioShatterhand opened this issue Sep 24, 2021 · 1 comment

Comments

@MarioShatterhand
Copy link

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"

@pbsds
Copy link

pbsds commented Aug 19, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants