Hi @NazarovALAL, unfortunately YouTube doesn't provide the same HTML code you see when accessing the page through your browser, hence why the xpath clause fails to get the views. This happened to other users before and the code there is a bit out of date for that purpose but still valid as an example if you want to access an HTML through .xpath().
You can do a test by looking for an website where you get the same HTML by other means other than the browser (using curl or wget for example)
xmltodict
python module, you can have more details here: https://pypi.org/project/xmltodict
Kovan
0x1d241954e00599797de78a4030297f9e4c45b77a4f018e2ee68d748bb104017c
, just in case u need it for investigation. I also try the https://app.provable.xyz/home/check_query
but it unable to find my query. I am not sure if that tool only check for query on the main net?
function update() public payable
{
emit LogNewProvableQuery("Provable query was sent, standing by for the answer...");
currentID = provable_query("URL", 'html(https://www.youtube.com/watch?v=9bZkp7q19f0).xpath(//*[contains(@class, "watch-view-count")]/text())');
}
I just added the currentID
parameter to store the query id, the rest is the same as the sample code in YoutubeViews.sol