Jump to content

Downloading from Secure Website


Recommended Posts

You have to toally rewrite you r code to use WinHTTP instead of _IE.

1) first you have to open a connection to the server

2) then you have to login

3*) now get the links & download

4) close connection

An example how it *should* work (without step 3*) http://www.autoitscript.com/forum/index.php?showtopic=111769&view=findpost&p=789024

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

You still have not said if the download links are all on one page or not? Also when you hover over a link what does it say in your status bar?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

You still have not said if the download links are all on one page or not? Also when you hover over a link what does it say in your status bar?

Actually I did... see post #19.

Yes they are all on the same page.

Thanks,

Terry

Link to comment
Share on other sites

This is getting easier by the minute but getting the information is like pulling teeth. When you hover over a download link, does your status bar show a link to a file or just a link to another php (or similar) page ar even to javascript. If it's actually to the files them selves then all we have to do is read the source and extract all the links.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

This is getting easier by the minute but getting the information is like pulling teeth. When you hover over a download link, does your status bar show a link to a file or just a link to another php (or similar) page ar even to javascript. If it's actually to the files them selves then all we have to do is read the source and extract all the links.

When I hover over the links I get something like this:

"https://xxx.xxx.com/X/wmv/file.wmv?ticket=85d559e7-fd3f-4ebc-aee3-18b07234c15f&id=e7ca1197-d96c-4e9c-a650-35e33eb0cee2"

or

"https://xxx.xxx.com/x/slides/file.pptx?ticket=85d559e7-fd3f-4ebc-aee3-18b07234c15f&id=e7ca1197-d96c-4e9c-a650-35e33eb0cee2"

Thanks,

Terry

Edited by mattw112
Link to comment
Share on other sites

Once you get the page source code you can run a RegExp against it to get all the links but I think you are probably better off in this case with the IE.au3 UDF.For that take a look at IE Management in the help file. I haven't used them for so long I've forgotten the sequence. The one to get the files should be _IELinkClickByIndex but before the you need _IEGetLinkCollection

If you choose the RegEx method then the reg ex will be something like

$sSrc = ;;this is where you get the source by whatever method I usually use BinaryToString(InetRead("http://www.someurl.com/some/folder/"))

$aLinks = StringRegExp($sSrc, "(?i)(?U)<a\s.*href=\W*(htt.+//.+\?ticket=.+id=.+)>", 3) ;; Create an array of links

The reg exp may need an adjust ment, for that we would have to see an actual piece of the source with the link in it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Once you get the page source code you can run a RegExp against it to get all the links but I think you are probably better off in this case with the IE.au3 UDF.For that take a look at IE Management in the help file. I haven't used them for so long I've forgotten the sequence. The one to get the files should be _IELinkClickByIndex but before the you need _IEGetLinkCollection

If you choose the RegEx method then the reg ex will be something like

$sSrc = ;;this is where you get the source by whatever method I usually use BinaryToString(InetRead("http://www.someurl.com/some/folder/"))

$aLinks = StringRegExp($sSrc, "(?i)(?U)<a\s.*href=\W*(htt.+//.+\?ticket=.+id=.+)>", 3) ;; Create an array of links

The reg exp may need an adjust ment, for that we would have to see an actual piece of the source with the link in it.

I got it working and you pointed me in the right direction.

I used the _IEGetLinkCollection like you mentioned, instead of doing the _IELinkClickByIndex though I'm just using the standard _IEAction click when certain criteria are met.

I already was able to get a list of the urls on the page using the $sHTML = _IEDocReadHTML ($oIE) command. But I wanted to pick and choose the ones I download, so I have some code to do that.

Anyway, the main thing that got me so I could get save as dialog boxes is:

$oLinks = _IELinkGetCollection($oIE)
                For $oLink In $oLinks
                    If $oLink.href = $url Then
                            _IEAction($oLink, "click")

From here I do a lot of controlsend and controlclick stuff and download each file to the appropriate directory.

Oh and I had to open security on IE8 to allow scripts to do all of this stuff.

The only thing frustrating me now, but isn't a big deal, is that certain file extensions .wmv and .pdfs wont launch a save as dialog, when you do a click on them they actually open and start doing stuff. So for now I'm just skipping links with those extensions. But would be nice if there was soemthing I could change or tweak to have those files just open a save as dialog too.

Thanks,

Terry

Link to comment
Share on other sites

In this case you should be able to use INetGet to get the mwv and pdf files. I would use INetGet along with InetGetSize() and InetGetInfo().

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...