Page 1 sur 1

[..] Internet explorer - Ouvrir tous les liens onglets

Posté : lun. 22 déc. 2014 12:29
par jcaspar
B :D onjour à tous !

Je souhaiterais ouvrir tous les liens d'un site Web dans des onglets distincts

pouvez vous svp m'expliquer comment m'y prendre ?

En vous remerciant pour vos conseils


Jean-Marc

Code : Tout sélectionner

#NoTrayIcon
#include <IE.au3>
#include <MsgBoxConstants.au3>

Opt("WinTitleMatchMode", 2)


_IECreate("www.google.fr")


$h=WinGetHandle("Internet Explorer")
$oIE = _IEAttach($h, "HWND")
$url = _IEPropertyGet($oIE, "locationurl")

MsgBox(64,"Internet Explorer",$url)

Local $iNumLinks = @extended
Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF

Local $oLinks = _IELinkGetCollection($oIE)


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

 

Re: [..] Internet explorer - Ouvrir tous les liens onglets

Posté : lun. 22 déc. 2014 17:53
par jbnh
Autoit ne permet pas cette fonctionnalité

Mais en fouillant dans les option d'internet explorer, c'est possible

Re: [..] Internet explorer - Ouvrir tous les liens onglets

Posté : lun. 22 déc. 2014 18:18
par mikell
Par exemple
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
► Afficher le texte

Re: [..] Internet explorer - Ouvrir tous les liens onglets

Posté : mar. 23 déc. 2014 09:11
par jcaspar
M :D erci pour vos suggestions ... ce qui donnerait le code ci dessous ...
mais peut être avez vous des suggestions pour améliorer les choses ...

Code : Tout sélectionner

 #include <IE.au3>
#include <MsgBoxConstants.au3>

Opt("WinTitleMatchMode", 2)


Global Const $navOpenInNewTab = 0x0800

_IECreate("www.google.fr")


$h=WinGetHandle("Internet Explorer")
$oIE = _IEAttach($h, "HWND")
$url = _IEPropertyGet($oIE, "locationurl")

MsgBox(64,"Internet Explorer",$url)

Local $iNumLinks = @extended
Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF

Local $oLinks = _IELinkGetCollection($oIE)


For $oLink In $oLinks
    $sTxt&= $oLink.href & @CRLF
;~  _IELinkClickByText($oIE,$sTxt)



    $oIE.Navigate2($oLink.href , $navOpenInNewTab, "_top")
_IELoadWait($oIE)
Sleep(2000)


Next
MsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt)



 

Re: [..] Internet explorer - Ouvrir tous les liens onglets

Posté : mar. 23 déc. 2014 14:32
par orax
Je n'ai pas compris pourquoi tu fais ça :

Code : Tout sélectionner

_IECreate("www.google.fr")

$h=WinGetHandle("Internet Explorer")
$oIE = _IEAttach($h, "HWND")
Autant remplacer ces lignes par :

Code : Tout sélectionner

$oIE = _IECreate("www.google.fr")