Cannot inject variables into a css html query

25 views
Skip to first unread message

spo...@gmail.com

unread,
Sep 28, 2022, 5:18:47 AM9/28/22
to Tasker
Hi,

Reading a very simple html page with a table in it.

%html[tr:nth-child«2»] Reads the 2nd row just like it is supposed to.

%html[tr:nth-child«%var»] While this returns only the code itself.

I've tried suffixing the % with all kinds of things.

The html is basically just
<html><body><table><tbody><tr><td>
</td></tr></tbody></table></body></html>
with a few tr's and a few td's populated with some nuclear plant runtime data.

spo

João Dias

unread,
Sep 29, 2022, 4:27:36 AM9/29/22
to tas...@googlegroups.com
Hi! Can you please export an example task of that as an URI (not a link, but a direct URI) and paste it here so I can then import it and test it myself?

Thanks in advance!

Thank you for your contact.

   Join: connect multiple devices (send pushes, remote SMS, notifications) on Android, Windows, Mac, Linux
   Tasker: customize/automate anything on your phone!
   AutoApps: add advanced functionality to Tasker via plugins

     

João Dias


RSF

unread,
Sep 29, 2022, 11:03:49 AM9/29/22
to Tasker
Possible workaround: put the child specification into a variable and then use that variable in the html/css reference:
Screenshot_20220929-075453.png

Seppo Välimäki

unread,
Oct 1, 2022, 12:00:03 PM10/1/22
to Tasker
Hi, I hope this Data URI is the right format.

taskertask://H4sIAAAAAAAAAO1XzW7aQBA+h6ewLCW3sLte2/zEWGqVQzlUrUSlHKoKLfYWLIyNlgWUZ+oj5JYn6/6AY4O9RmnVplK5eGa+b4bxx3jMBl/IZknZPeHE2rCRbVvxLhnZyLb4bmT7XdTFtzPKiR12rgLJVSwuDISgDF4FUUw4DZHvu47vYwhdOAiADkqYFrCPB9B1oe8HgBZwEoeiUgDEVbrZioaf8z1l65RkfMo3PAAyJrE1S0IEBVcaMvAu4kmeqY5IxKFt7ejI7qmuRFt5TEPP7YlepKViE840m80PbGyH1wu+CoCAzjio4Nyk/E7Q0ps5v5P2LI8fpd2RDiezlCrPEh8VWVASF5EiyiqhF7IMj++lDbTTwHmgdBmTx3ai+DlpO+tjngmjlfYh37J2lvrR6mg6xir6gKpAqkoh6SWSqVykS8UGyoTwLSskMzEh6iLYdaDjtHM/RTyfHe/WXHQIYTsNef1+HetUuotUuaD/v62K8+dVwW9fFfxbVdF+ZU+BYlEp74gp57jcSotwnPHjInTEIiTpyIY2OMOwAXMNmHfAcA3mHzCksQDoTV+z9NFrl/6OsLal7/1rYjh1YniwLIbI+07SDQ2ArlAvDzCoci1e3fXKOc3puEh/n8wn63xdL+1RIh+aRGoXAtdORb91Kh4Svsi3XHwNS+SzMrTkn4OvnA3Fm/I2WiRp/PwDPz/JJ4XH5aD3/PSt/p5QteuqqqeKl/POEsvg2RCWq2JDVdMUmoqe1ixBbjPkNUN+M9RrhvrNtzaodm8YD/cXxuMVsyF3zf/xeMvjMV7NFS2JMl3AOYyGPHqs9lOiqNM5y7fr6T5ny5dDCRC58mwE5OEo7OirPlCFnZ/tYK+PXg0AAA==

Seppo Välimäki

unread,
Oct 2, 2022, 3:49:31 AM10/2/22
to Tasker
Thank you, RSF, putting css paths to variables works!

However, it appears that the path (everything inside the square brackets) must be inside one variable, you cannot split it into: %html[%table-row-path>%table-td-path]

Instead you first need to combine those two paths into one var:
%whole-path = %table-row-path>%table-td-path

and then simply do %html[%whole-path].

Or you may write the whole path variable in one go:
%whole-path = tr:nth-child«%tr-num»>td:nth-child«%td-num».

spo
Reply all
Reply to author
Forward
0 new messages