Jump to content
phamtua

Find link in tag name "a"

Recommended Posts

phamtua

Hi all, please help me get link of this tag name called "a"
 

<a href="https://video-lga3-1.xx.fbcdn.net/v/t42.9040-2/31722452_600373350325502_2471331569462149120_n.mp4?_nc_cat=0&amp;efg=eyJybHIiOjUyMiwicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoic3ZlX3NkIn0%3D&amp;rl=522&amp;vabr=290&amp;oh=471bd4ed5bd1821ea21cbd1318be5aa9&amp;oe=5B236FDB" download="-fbdown.net.mp4"><strong style="font-size:19px;" class="text-primary">Download Video in Normal Quality</strong></a>

My code:
 

#include <IE.au3>
Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended

Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF
For $oLink In $oLinks
    $sTxt &= $oLink.href & @CRLF
Next
MsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt)


 I tried to use this code (below) but it show many links, I need to return this link: 
https://video-lga3-1.xx.fbcdn.net/v/t42.9040-2/31722452_600373350325502_2471331569462149120_n.mp4?_nc_cat=0&efg=eyJybHIiOjUyMiwicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoic3ZlX3NkIn0%3D&rl=522&vabr=290&oh=471bd4ed5bd1821ea21cbd1318be5aa9&oe=5B236FDB

Share this post


Link to post
Share on other sites
Subz

So do you know the name of the url before hand?  What exactly are you trying to achieve?

 

Share this post


Link to post
Share on other sites
phamtua

I'm trying to make a application get link to download video on Facebook
This web support get link: https://www.fbdown.net/
After set value to the input and click Download button, I need to extract link
image.thumb.png.b9cf4e75b43776007d3335ce23a8f59f.png
 

Share this post


Link to post
Share on other sites
Subz

Sorry had errands to run, you can use something like:

#include <IE.au3>
Local $oIE = _IEAttach("https://www.fbdown.net/download.php", "url")
Local $oIETag = _IEGetObjById($oIE, "sd")
ConsoleWrite("URL = " & $oIETag.firstElementChild.href & @CRLF)

 

Share this post


Link to post
Share on other sites
phamtua

Thank you, @Subz, you're handsome :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×