Jump to content
Sign in to follow this  
knight666

Extracting hyperlinks from a website

Recommended Posts

knight666

I was wondering, is there a stable way to extract the hyperlinks from a website?

I'm using Firefox, and the way I do it right now is this:

-Press right mouse button on a certain location

-Press ctrl + b (to show source)

-Press ctrl + a, ctrl + c

-Do some hyperlink searching voodoo

-Press ctrl + F4

But if there happens to be an image on that exact location, showing the website's source won't work and obviously it won't work in IE either.

Please help.

Share this post


Link to post
Share on other sites
Shevilie

Though you are using Firefox have a look at the IE UDF since it have a build in capture all link function, would be a lot easier :)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites
Clouds

Isn't this easier (in FF):

-Press ctrl+U (show page source)

-Do some hyperlink searching voodoo

-Press ctrl+F4

Guess that is only works when the page has no frames though...

--

Clouds®

Share this post


Link to post
Share on other sites
knight666

Isn't this easier (in FF):

-Press ctrl+U (show page source)

-Do some hyperlink searching voodoo

-Press ctrl+F4

Guess that is only works when the page has no frames though...

--

Clouds®

Hey, thanks, that did the trick. >:)<

I looked in Firefox's manual, but I didn't see that one listed.

Share this post


Link to post
Share on other sites
big_daddy

You might also try...

#include <IE.au3>

$sURL = "http://www.autoitscript.com/autoit3/"
$sSearch = "SciTE"

$oIE = _IECreate($sURL)
$oLinks = _IELinkGetCollection($oIE)
$iNumLinks = @extended
ConsoleWrite("Link Count: " & $iNumLinks & @CRLF)
For $oLink In $oLinks
    If StringInStr($oLink.href, $sSearch) Then
        ConsoleWrite($oLink.href & @CRLF)
    EndIf
Next

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.