Xaver Posted January 15, 2007 Share Posted January 15, 2007 Dear Ladies and Sirs,I've written a small script which retrieves the URL of a website displayed in the active IE-Window with the handle$WindowHandle. Everything works fine except when the active IE-Window shows a pdf-file(e.g. http://www.greenhouse.gov.au/yourhome/technical/pdf/fs34e.pdf).Then the line $oIE = _IEAttach($WindowHandle, "hwnd") returns 0 for $oIE. Would anybody please be so kind andgive me a hint what went wrong?By the way:is there an easy route to save a whole website (including all pictures and text and ideally preserving the layout)automatically (that is setting the path and filename via AutoIt)?I tried _IEAction ($oIE, "saveas") but then I still have to negotiate a dialog window where I have to navigate to thedesired folder and to fill in the filename.When using $sHTML = _IEDocReadHTML ($oIE) the pictures and buttons are sometimes missing in the stored data.What have I done wrong?AutoIt is great, but it needs a lot of practice. But I keep trying... and hoping for occasional help from "gurus"...Best regards,Xaver Link to comment Share on other sites More sharing options...
DaleHohm Posted January 15, 2007 Share Posted January 15, 2007 Dear Ladies and Sirs,I've written a small script which retrieves the URL of a website displayed in the active IE-Window with the handle$WindowHandle. Everything works fine except when the active IE-Window shows a pdf-file(e.g. http://www.greenhouse.gov.au/yourhome/technical/pdf/fs34e.pdf).Then the line $oIE = _IEAttach($WindowHandle, "hwnd") returns 0 for $oIE. Would anybody please be so kind andgive me a hint what went wrong?I'm amazed that this has never come up before - turns out there are a bunch of issues here. No, _IEAttach cannot attach to a browser displaying a pdf document, nor can _IELoadWait test it's completion status (and thus not _IECreate or _IENavigate).The issue is that IE is hosting a custom interface for Abobe PDF. There is a document, but the document type is IAcroAXDocShim and it doesn't have the properties of an HTML document (e.g., no readyState property - which explains why all _IELoadWait calls timeout).I will look into this, but for now it is a limitation.By the way:is there an easy route to save a whole website (including all pictures and text and ideally preserving the layout)automatically (that is setting the path and filename via AutoIt)?I tried _IEAction ($oIE, "saveas") but then I still have to negotiate a dialog window where I have to navigate to thedesired folder and to fill in the filename.When using $sHTML = _IEDocReadHTML ($oIE) the pictures and buttons are sometimes missing in the stored data.What have I done wrong?AutoIt is great, but it needs a lot of practice. But I keep trying... and hoping for occasional help from "gurus"...Best regards,XaverSecurity restrictions in the browser prevent doing a silent Save As... -- sorry, I know of no workaround.Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
seandisanti Posted January 15, 2007 Share Posted January 15, 2007 I'm amazed that this has never come up before - turns out there are a bunch of issues here. No, _IEAttach cannot attach to a browser displaying a pdf document, nor can _IELoadWait test it's completion status (and thus not _IECreate or _IENavigate).The issue is that IE is hosting a custom interface for Abobe PDF. There is a document, but the document type is IAcroAXDocShim and it doesn't have the properties of an HTML document (e.g., no readyState property - which explains why all _IELoadWait calls timeout).I will look into this, but for now it is a limitation.Security restrictions in the browser prevent doing a silent Save As... -- sorry, I know of no workaround.DaleAnawave WebSnake. It's a program that you can use to download full websites, including directory structure, media etc. you can set the depth and size limitations and just let it go. Link to comment Share on other sites More sharing options...
DaleHohm Posted January 15, 2007 Share Posted January 15, 2007 Anawave WebSnake. It's a program that you can use to download full websites, including directory structure, media etc. you can set the depth and size limitations and just let it go.Ah, right - there are quite a few utilities like this that can be used -- thanks cameronsdad Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
seandisanti Posted January 15, 2007 Share Posted January 15, 2007 Ah, right - there are quite a few utilities like this that can be used -- thanks cameronsdadNo problem, always glad to help. i always liked that one because it would let you retain the directory structure in your downloaded copy. Link to comment Share on other sites More sharing options...
libsifa1 Posted November 5, 2013 Share Posted November 5, 2013 Hello, I know that this topic posted by Xaver on January 15 2007 is now over 6 years old, but recently, I was concerned too My AutoIt script runs on Win7-64 and it is a kind of robot simulating a user that use Oracle Argus Safety (it is a web based app with ASP, so IE mandatory) to collect application response time. One of the collected data is time it takes to download a pdf. With IE9, the biggest issue was the download and security check of the PDF. -- Strangely, when I do manually what the robot does, it takes one second to pass the security check. When the robot does it, it takes up than 20 seconds - the adobe setting was PDF not displayed in the browser ---. To avoid the security check feature of IE9, I defined the pdf to be displayed in the browser. And I got the issue described in this topic. Thanks to DaleHolm to explain why it happens: this makes it clear for me. I found a way to bypass the issue - the solution was to use the free brava reader and enable display pdf in browser, software to be found at http://www.bravaviewer.com/free-software-view-and-print-pdf-tiff-and-csf. Maybe my post will help somebody else, even 6 years later ;-) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now