Sign in to follow this  
Followers 0
FireFox

Get first link of google search results

5 posts in this topic

Hi,

I want to know if its possible to get first web site link of google search results like when you click on "I'm Feeling Lucky" without navigate...

Thanks for anyhelp or idea :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites



Something like this maybe?:)

#include <ie.au3>
$searchterm=StringReplace("AutoIt Wikipedia"," ","+")
$ie=_IECreate("http://www.google.com/search?hl=en&q="&$searchterm&"&btnG=Google+Search&aq=f&oq=",0,0)

$links=_IELinkGetCollection($ie)

$i=0
For $link In $links
    If $i=23 Then 
        MsgBox(0,$link.innerText,$link.href)
        ExitLoop
    EndIf
    
    $i+=1
Next

_IEQuit($ie)

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

@monoceres

Thanks for your suggestion, but I want to do it without navigate, like a direct link :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Got it!

#include <ie.au3>
$searchterm = StringReplace("AutoIt Wikipedia", " ", "+")
$url = "http://www.google.com/search?hl=en&q=" & $searchterm & "&btnI=I%27m+Feeling+Lucky&aq=f&oq="

$answer = MsgBox(68, "?", "Direct link to AutoIt Wikipedia is:" & @CRLF & $url & @CRLF & "Navigate now?")
If $answer = 6 Then ShellExecute($url)

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

@monoceres

Thanks, you rock ! :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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  
Followers 0