Sign in to follow this  
Followers 0
wojciech

How use IE Popup when IE is embedded in my form

4 posts in this topic

Hi there!

It is my first post on this forum. Welcome AutoIt maniacs :graduated:! English is my second language so please forgive me grammar mistakes.

I have problem. I'm looking for information in help, forums and I stuck. I'm working on script to download manager. It'll be use for downloading historical text from Digital Library Framework (http://dlibra.psnc.pl/index.php?lang=en). It's not comfortable manually download fx. daily newspaper from 1920s. It is about 300 issues for year...

What I do?

I create form with Koda. With _IECreateEmbedded() and GUICtrlCreateObj() I embedded Internet Explorer on it. Script works with pages like that:

Demo of dLibra downloading & reading book. I start downloading with code:

_IENavigate($AX_IE_MiejsceDoOtwieraniaStron,GUICtrlRead($InputDownloadingBookAdress)) ;Open page with book on form
_IEImgClick ($AX_IE_MiejsceDoOtwieraniaStron, "download.gif", "src")                  ;Click "Download" image (floppy icon).

After that it shows pop up with information that is compressing book file. On this windows is link "Click to download". On <a href=""> is link to file. I would take them and download file with INetGet.

Problems

I can't focus on the window. I try:

$hPopup = WinGetHandle("[CLASS:Internet Explorer_Server; INSTANCE:1]")

$sTitle = WinGetTitle($hPopup)
$sText = WinGetText($hPopup)
MsgBox(64,"SUCCESS!","Title = " & $sTitle & "  Text = " & $sText)

But this way I get focus on Internet Explorer in my Script Form. I try too:

If WinActive("Windows Internet Explorer","Jeżeli pobieranie nie rozpocznie się w ciągu kilku sekund Kliknij aby pobrać") Then
MsgBox(0, "Zauważyłem!", "CLASS:Internet Explorer_Server; INSTANCE:1]") ;Info that I get focus on pop up window
_IELinkClickByText ($AX_IE_MiejsceDoOtwieraniaStron,"Kliknij aby pobrać")

Jeżeli pobieranie nie rozpocznie się w ciągu kilku sekund Kliknij aby pobrać - English: If downloading not start in few second Click to download.

From AutoIt v3 WindoInfo I get:

>>>> Window <<<<
Title:  http://dlibra.psnc.pl/?id=1 - Przykładowa Biblioteka Cyfrowa - Windows Internet Explorer
Class:  IEFrame
Position:   191, 0
Size:   482, 381
Style:  0x16CF0000
ExStyle:    0x00000100
Handle: 0x0017061E

>>>> Control <<<<
Class:  Internet Explorer_Server
Instance:   1
ClassnameNN:    Internet Explorer_Server1
Name:   
Advanced (Class):   [CLASS:Internet Explorer_Server; INSTANCE:1]
ID: 
Text:   
Position:   0, 0
Size:   474, 354
ControlClick Coords:    231, 187
Style:  0x56000000
ExStyle:    0x00000000
Handle: 0x00140956

>>>> Mouse <<<<
Position:   231, 187
Cursor ID:  0
Color:  0xFFFFFF

>>>> StatusBar <<<<
1:  Gotowe
2:  
3:  
4:  
5:  
6:  
7:  
8:  
9:  
10: 

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
http://dlibra.psnc.pl/?id=1 - Przykładowa Biblioteka Cyfrowa - Windows Internet Explorer


>>>> Hidden Text <<<<
Pasek nawigacyjny
http://dlibra.psnc.pl/demo/dlibra/doczip?id=1
Formant kombi adresu
Formant strony
Google
Formant kombi wyszukiwania
Formant wyszukiwania
Pasek poleceń
Pasek poleceń Ulubione
ITBarHost
Pasek menu
Gotowe
Stopień powiększenia

What I want to do?

Script I would use:

1. Download URL from dLibra library Web Search Engine - http://fbc.pionier.net.pl/owoc

2. Taken links write to INI file

3. Sort Library (some listened files on page FBC Pionier.net not use dLibra but other file):

- if not use dLibra delete link

4. Open page on Script form

5. Click download

6. Catch URL to file and get them download with INetGet

7. Proceed 4 for 6 for next file.

8. End program.

Questions

1. How get link to file in pop up window?

2. Is any way to open pop up in form?

3. My algorithm is correct? Any suggestion with that? Easier way?

Thank you for your advices!

Best wishes,

Wojciech

Share this post


Link to post
Share on other sites



The popup is like a completely separate IE window. You can get a reference to it with _IEAttach() using the "DialogBox" parameter (see help file).

Once you have a reference to the dialog box (popup) you can work with the page elements the same way you would with the main instance of IE.

:graduated:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I try:

$DownloadFileFromPopup = _IEAttach("[CLASS:Internet Explorer_Server; INSTANCE:1]", "DialogBox")
_IELinkClickByText ($DownloadFileFromPopup,"Kliknij aby pobrać")                                ;visible text of link (Click to download)

I try too:

_IEAttach ("Jeżeli pobieranie nie rozpocznie się w ciągu kilku sekund", "text")  ;text from popup

When I use:

If _IEAttach("[CLASS:Internet Explorer_Server; INSTANCE:1]", "DialogBox") Then
    MsgBox(4096,"Stats", "I get popup!")
Else
    MsgBox(4096,"Stats", "I did not get it")

I only see "I did not get it" message. What I do wrong? It is not working.

Edited by wojciech

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hey,

I've the same problem right now.

Did you solved it?

My problem:

I used the embedded IE within AutoIT form. 
At the page I navigate though is a button with 'upload files' and when I open there is a pop up to select the files which should be uploaded.

I don't get grabed the pop-up.

Edited by OtenMoten

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