I am using the function InetGet example in the help files on a website and getting the error 13. First, I searched the help files and the forum for a list of errors to consult to no avail. I suspect this is a 400's server reply based error but it would be nice to get more info about it.
Please help, thanks.
Hi Guys, I need help. I have searched the forum before posting and i couldn't find anything. The code below works fine when downloading files from "http" sites, but when trying to download from "https" sites, no files are downloaded. I tried different sites and I experience the same problem everywhere. Is there something I'm missing or doing wrong? Please note that I'm not a programmer and I'm new to this. I'm just using logic wherever i can to get things done. your help will be highly appreciated.
; Download a file in the background.
; Wait for the download to complete.
; Save the downloaded file to the temporary folder.
Local $sFilePath = "d:\"
; Download the file in the background with the selected option of 'force a reload from the remote site.'
Local $hDownload = InetGet("https://en.wikipedia.org/wiki/HTTPS#/media/File:Internet2.jpg", $sFilePath& "Internet2.jpg", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True.
Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
; Retrieve the number of total bytes received and the filesize.
Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
Local $iFileSize = FileGetSize($sFilePath&"Internet2.jpg")
; Close the handle returned by InetGet.
; Display details about the total number of bytes read and the filesize.
MsgBox($MB_SYSTEMMODAL, "", "The total download size: " & $iBytesSize & @CRLF & _
"The total filesize: " & $iFileSize)
; Delete the file.
First script here. Thanks for taking the time.
I want to download a file from my dropbox or other cloud file host and I want autoit to read the file and proceed.
Here are the references I've gone through, it's just I'm not familiar yet with autoit so I'm looking for advice:
How would I start out downloading a text file from dropbox and if in the file there is a 1 then it will proceed with the rest of the script if there is a 0 or if the file cannot be downloaded I want it to just end.
Thank you for taking the time to read this and I apologize in advance if this seems very trivial for some but this is my first script and I'm hoping this is the correct place to ask this question.
Since I'm able to get a Dell equipment warranty status thanks to my API key, I'm using an UDF to extract data from an XML file and get the end date. >
Thing is, when using InetGet, the original file is in JSON format and the UDF is not working anymore, even if I download the file with the xml extension. Therefore, and when I manually download the page with Chrome, I have a proper XML file where the UDF is working fine.
Here's my code:
I even tried to convert the json to xml > https://www.autoitscript.com/forum/topic/185717-js-json-to-xml/
I took a look here https://www.autoitscript.com/forum/topic/104150-json-udf-library-fully-rfc4627-compliant/ but I don't understand anything :/
The XML read UDF is just perfect for my needs but I'm stuck here...
Thanks for any help you can provide
My script uses IE11 on Win7 to log in to a site and enters data into a couple of forms. Upon clicking a link this data is used by the site to generate a PDF report.
With my current set-up if I do this manually the PDF opens in a new IE tab and I can download or print it. If I right-click the link that creates the PDF and choose Save Target As the PDF is generated and the Open/Save As dialogue at the bottom of the screen opens. All good.
However I would like the script to automatically download the PDF and close IE and then exit. Closing IE (_IEQuit) and exiting the script are easy enough, but I'm struggling getting the script to download the PDF.
The link to generate the PDF contains a unique number each time the page with the link is reached, so it's not static. The link position however, using _IELinkGetCollection I can tell the link to generate the PDF is always the 10th one from the end of the page, so using $iNumLinks - 10 I am able to click the link.
What I believe I need to use is InetGet however the problem I've been facing is that the link isn't static and I haven't worked out a way to access the link by index - is this possible?
Here is the website HTML for the section containing the link although I don't think it's of much use but it at least shows the format of the link (I can't post a link as it's a password protected area)...
<div class="rmButton right"><a title="Generates a PDF version of the market report in a new window." href="/rmplus/generatePdf?mr_id=60991" target="_blank">print/save as pdf</a></div> The full link https://www.rightmove.co.uk/rmplus/generatePdf?mr_id=60991 just for completeness - visiting it will give a HTTP 500 unless logged in.
And here is the code that clicks this link opening the generated PDF in a new tab...
$oLinks = _IELinkGetCollection($oIE) $iNumLinks = @extended $PrintPDF = _IELinkClickByIndex($oIE, ($iNumLinks - 10)) So, how to use InetGet to visit that link? Or is there a way to Save As the newly opened tab? I've tried _IEAction($oIE, "saveas") but it seems not to work in a tab containing only a PDF.