How To Run document query selector in Javascript ? Unable To Do

Hello Guys ,

I Am Trying to Perform Particular Action In A Website Using Webview Javascript .

I Am Performing action using button in webviwer { Using ID }

I Am Using This : document.getElementById(“test_id”).click(); but in some case element ID is not there So Decided to Use Some Other Function Like document.getElementByClass Or document.querySelector But Both the function not working…

What I Am Trying To Do :

There Is HD Mp4 Download Button I wanna Click That Using Some Class & Run in javascript webviweer.

So What I Tried :

I Have Tried

document.getElementsByClassName(“fas fa-video”)[0].click();

But It Doesn’t Work Then I tried this

document.getElementsByClassName(“btn btn-info btn-sq btn-dl”)[0].click();

But Again Its Not Working Then Again After Reading So Many Post in community &

Stockoverflow website & And After Discussing I tried Something Like This

document.querySelector("#links > > a:nth-child(1)")

But Again It Still Not Working :cold_sweat: :cold_sweat: :cold_sweat:

So Now After Taking Some Hopes I Came In The Community to Ask my Question For Help.

I Wanna Know Is There Any Method to perform A Click On Blue Button ( HD Mp4 Download Button )

Thanks In Advance
I Hope I will Get Some Solution

In which website you are trying to do this?

1 Like

I am trying this video url from website

For Clicking SD Button


For Clicking HD Button

1 Like

Nothing Happens , No Response , Again Same Issue button not clicking

Here What I Am Trying…

You asked for clicking on button, thats what this code is doing.
Manually clicking on that button (SD Button) is also not working in webviewer.
You can use other facebook video downloader like
Here are the blocks to use with the above website

Here Screen you can import
SampleApp.ais (2.9 KB)


Thanks For The Help …

But Can You Explain Me In Detail How You Have Done That…

1 Like

Thanks For the Help Can You Give One More

What Will Be the Classname Or ClassId For Thumbnail Of A Video.

Please Reply . I Waiting For your Response…

How Can I Get Thumbnail ??

Beacuse Of this I am stuck in middle.

For getting Thumbnail Image Url


After Javascript result it shows only thumbnail url Why ??

By The Many Many Thanks You Are Brilliant :laughing: :partying_face: :partying_face: :partying_face: :love_you_gesture: :love_you_gesture: :smiling_face_with_three_hearts: :stuck_out_tongue_winking_eye:

After Javascript evaluation, the event block returns the currently executed js that why it returns thumbnail URL.
You can use the below code it will return sdlink, hdlink and thumbnail URL at once in json format

(function() {  
var fbData = new Object(); 
fbData.sdlink = document.getElementById("sdlink").href; 
fbData.hdlink = document.getElementById("hdlink").href; 
fbData.image = document.getElementsByClassName("lib-img-show")[0].src; 
return JSON.stringify(fbData); 

Superb Awesome No Words to Say Thanks

You Help Me A Lot

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.