Jump to content

AUTO download solution


Recommended Posts

Hi people. i am new here and dont know anything about writing code. literally anything. But i needed a program which download for me. so i was looking a program which make program and found autoit. this is how i found auto it. i tried something but i am looking better solutions from you coders.

what my problem is about Web of science web site. you download lots of article with 500 sets. so you have to download 500 article in a set each time. after you made search you click "send to other file format" link.

9imvA8kl.png

after you click popup screen come and you write which set you want to download each time. first time you write 1-500 then 501-1000 then 1001-1500.... 99501-100000

agepZ2tl.png

then you choose record content and file format. then press send to download this set.

TWebRFll.png

finally your file download. and you made this all for next set.

i made this code for download this files automatically.

#include <AutoItConstants.au3>
Sleep(5000)
MouseClick($MOUSE_CLICK_LEFT, 545, 336, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 400, 302, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 472, 302, 1)
Sleep(1000)
Send("1")
MouseClick($MOUSE_CLICK_LEFT, 540, 302, 1)
Sleep(1000)
Send("500")
MouseClick($MOUSE_CLICK_LEFT, 440, 335, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 471, 400, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 497, 383, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 437, 448, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 473, 418, 1)
Sleep(40000)
MouseClick($MOUSE_CLICK_LEFT, 745, 239, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 1005, 575, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 545, 336, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 400, 302, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 472, 302, 1)
Sleep(1000)
Send("501")
MouseClick($MOUSE_CLICK_LEFT, 540, 302, 1)
Sleep(1000)
Send("1000")
MouseClick($MOUSE_CLICK_LEFT, 440, 335, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 471, 400, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 497, 383, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 437, 448, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 473, 418, 1)
Sleep(40000)
MouseClick($MOUSE_CLICK_LEFT, 745, 239, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 1005, 575, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 545, 336, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 400, 302, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 472, 302, 1)
Sleep(1000)
Send("1001")
MouseClick($MOUSE_CLICK_LEFT, 540, 302, 1)
Sleep(1000)
Send("1500")
MouseClick($MOUSE_CLICK_LEFT, 440, 335, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 471, 400, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 497, 383, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 437, 448, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 473, 418, 1)
Sleep(40000)
MouseClick($MOUSE_CLICK_LEFT, 745, 239, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 1005, 575, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 545, 336, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 400, 302, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 472, 302, 1)
Sleep(1000)
Send("1501")
MouseClick($MOUSE_CLICK_LEFT, 540, 302, 1)
Sleep(1000)
Send("2000")
MouseClick($MOUSE_CLICK_LEFT, 440, 335, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 471, 400, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 497, 383, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 437, 448, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 473, 418, 1)
Sleep(40000)
MouseClick($MOUSE_CLICK_LEFT, 745, 239, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 1005, 575, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 545, 336, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 400, 302, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 472, 302, 1)
Sleep(1000)
Send("2001")
MouseClick($MOUSE_CLICK_LEFT, 540, 302, 1)
Sleep(1000)
Send("2500")
MouseClick($MOUSE_CLICK_LEFT, 440, 335, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 471, 400, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 497, 383, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 437, 448, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 473, 418, 1)
Sleep(40000)
MouseClick($MOUSE_CLICK_LEFT, 745, 239, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 1005, 575, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 545, 336, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 400, 302, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 472, 302, 1)
Sleep(1000)
Send("2501")
MouseClick($MOUSE_CLICK_LEFT, 540, 302, 1)
Sleep(1000)
Send("3000")
MouseClick($MOUSE_CLICK_LEFT, 440, 335, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 471, 400, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 497, 383, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 437, 448, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 473, 418, 1)
Sleep(40000)
MouseClick($MOUSE_CLICK_LEFT, 745, 239, 1)
Sleep(1000)
MouseClick($MOUSE_CLICK_LEFT, 1005, 575, 1)

it is going like this towards 100000. it is the limit of web of science.

 

hereis my question. if screen moves every thing goes wrong. because mouse goes exact coordinates and its not correct when screen moves. i need mouse, move to text and click it. can autoit find where the text is and click it.

and i need something useful to download waiting code. when you press "send" download not start instantly. some times it waits 20 seconds some times less, some times more. i made my code wait 40 seconds after click send button. could it be like when mouse click send button, wait until download start and after download finished mouse close all notifications and made it again. i mean i ne mouse must know download and make next move after download complete.

are these things possible with auto it. and how can i made with zero code knowledge.

 

 

thanks in advance.

Edited by MakinisT
Link to comment
Share on other sites

You cannot make it with zero code knowledge.

Your best bet is to look at, study, and test the examples of the IE standard include functions.

Open help file and type _IE into the index tab, you will se a list of functions.

Start with _IECreate then _IENavigate and go from there.

Each function has an example in the help file.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I personally would pull apart the source code page until I get to the download links and download the files. Something like I did in this tutorial where I demonstrated arrays: https://www.youtube.com/watch?v=IeH5iKfI8DY&index=8&list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z

You can experiment with people's UDF's but I rarely ever use any UDF that doesn't come with AutoIt for personal reasons.

However, using my method I have been able to automatically surf sites, like page 1, page 2 etc and only storing links to articles or downloads of things I am interested in. For example free sound effects downloads or UK top 40 charts and that kind of approach would probably work for you if there were things you needed to download. With AutoIt there are many ways of doing things, I just tend to use this method because I fully understand it and find it invaluable. I did make myself a UDF to pull things apart recursively until I get to what I want but it is so long between using it that I have to check the comments in it to figure out how to make use of it. still, it does save me some time. I might test it and if it works now that I updated AutoIt, I might paste it here in case anyone else is interested. I may even have done that already at some point, not sure.

Link to comment
Share on other sites

UDF:

#include-once
#include <String.au3>

#cs
    ;   To program the function with before and after areas do the following
    (This breaks the source code down into chunks, then breaks those chunks into chunks and then breaks those chunks into chunks until you arrive at the exact data you need.
    By the way this also includes multiple entries of data, this following example shows one piece of data only and thus will return 1 entry array. More data sections = more array entries returned.

    For example Source code containing

    "<BeforeMain>This source code is big<CloserMain>This right here is not the current temperature outside<RightBetweenHere>GOLD FINGER<AndThisPart> But one day it could be<AfterCloserMain>But not big enough to cause a problem<AfterMain>"

    Chunk(0, '<BeforeMain>', '<AfterMain>')
    Chunk(0, '<CloserMain>', '<AfterCloserMain>')
    Chunk(0, '<RightBetweenHere>', '<AndThisPart>')

    ;   Then to fire it off to get a return array containing all of the resulting chunks of data

    $Variable = Chunk('http://www.google.com')

    ;   Or you can provide raw source code in binary format to prevent online retrieval of source code that you may be getting multiple different pieces of data from one piece of source.

    $Variable = Chunk($WebPageBinarySourceCode)

    ;   Or to remove all leading/trailing spaces, tabs, new lines etc...

    $Variable = Chunk('http://www.google.com', 1)

    ; Or to run the processing case sensitive add an extra parameter after the space stripping one shown above...

    $Variable = Chunk('http://www.google.com', 1, 1) ; Case sensitive

    $Variable = Chunk('http://www.google.com', 1, 0) ; Not case sensitive

    $Variable = Chunk('http://www.google.com', 1) ; Also not case sensitive due to the parameter being missing.

    ;   To clear all previously input chunk parameters you can do the following:

    Chunk(1)
#ce

Func Chunk($_BinarySourceOrStringURL, $_Import1 = '', $_Import2 = '')
    Local Static $_Zones[0]
    Select
        Case $_BinarySourceOrStringURL = String(0)
            If Not $_Import1 Or Not $_Import2 Then
                Local $_error[1]
                SetError(3) ; Both chunk before and after parameters are required for chunk parameters to be entered. All chunk parameters will now be reset. Please fix your script to supply both chunk before and after parameters.
                ReDim $_Zones[0]
                Return $_error
            EndIf
            ReDim $_Zones[UBound($_Zones) + 2]
            $_Zones[UBound($_Zones) - 2] = $_Import1
            $_Zones[UBound($_Zones) - 1] = $_Import2
            Return
        Case $_BinarySourceOrStringURL = String(1)
            ReDim $_Zones[0]
    EndSelect
    Local $_chunks[0]
    Select
        Case UBound($_Zones) = 0
            Local $_error[1]
            SetError(4) ; Both chunk before and after parameters are required. Either you forgot to add one or called the function to process source/URL without setting chunk parameters.
            ReDim $_Zones[0]
            Return $_error
        Case IsBinary($_BinarySourceOrStringURL)
            $_BinarySourceOrStringURL = BinaryToString($_BinarySourceOrStringURL)
        Case IsString($_BinarySourceOrStringURL)
            $_source = InetRead($_BinarySourceOrStringURL, 3)
            If @error Then
                Local $_error[1]
                Select
                    Case Not $_BinarySourceOrStringURL
                        SetError(1) ; Binary source code should have been provided but wasn't. The URL that was used is incorrect or there's a network problem. You may try again, the chunk parameters are intact.
                    Case $_BinarySourceOrStringURL
                        SetError(2) ; A URL was provided but there was a problem accessing it. Likely a network issue or a bad URL. You may try again, the chunk parameters are intact.
                EndSelect
                ReDim $_Zones[0]
                Return $_error
            EndIf
            $_BinarySourceOrStringURL = BinaryToString($_source)
    EndSelect
    Switch $_Import2
        Case 0
            $_CaseSenseChoice = False
        Case 1
            $_CaseSenseChoice = True
    EndSwitch
    ReDim $_chunks[UBound($_chunks) + 1]
    $_ProcessThis = _BetweenList($_BinarySourceOrStringURL, $_Zones[0], $_Zones[1], $_CaseSenseChoice)
    If @error Then
        SetError(@error)
        Local $_error[1]
        ReDim $_Zones[0]
        Return $_error
    EndIf
    For $Go = 2 To (UBound($_Zones) - 1) Step 2
        $_ProcessThis = _BetweenList($_ProcessThis, $_Zones[$Go], $_Zones[$Go + 1], $_CaseSenseChoice)
        If @error Then
            SetError(@error)
            Local $_error[1]
            ReDim $_Zones[0]
            Return $_error
        EndIf
    Next
    If $_Import1 Then
        Local $_TempBuffer[0]
        For $ap In $_ProcessThis
            ReDim $_TempBuffer[UBound($_TempBuffer) + 1]
            $_TempBuffer[UBound($_TempBuffer) - 1] = StringStripWS(StringStripCR(StringReplace(StringReplace($ap, @TAB, ''), @LF, '')), 3)
        Next
        ReDim $_Zones[0]
        Return $_TempBuffer
    EndIf
    ReDim $_Zones[0]
    Return $_ProcessThis
EndFunc   ;==>Chunk

Func _BetweenList($_DataArrayInput, $_Before = '', $_After = '', $_CaseSensitive = False)
    Local $_Buffer[0]
    If Not IsArray($_DataArrayInput) Then
        $_tempCheck = _StringBetween($_DataArrayInput, $_Before, $_After, $_CaseSensitive)
        If Not @error Then
            Return $_tempCheck
        Else
            SetError(5) ; Nothing came back from the breakdown of the source.
            Local $_error[1]
            Return $_error
        EndIf
    EndIf
    For $_Process In $_DataArrayInput
        $_temp = _StringBetween($_Process, $_Before, $_After, $_CaseSensitive)
        If Not @error Then
            For $_processing In $_temp
                ReDim $_Buffer[UBound($_Buffer) + 1]
                $_Buffer[UBound($_Buffer) - 1] = $_processing
            Next
        EndIf
    Next

    If Not UBound($_Buffer) Then
        SetError(6) ; Nothing came back from the subsequent breakdowns of the source.
        Local $_error[1]
        Return $_error
    EndIf
    Return $_Buffer
EndFunc   ;==>_BetweenList

Func DeletemeChunk()
    ConsoleWrite('Successfully tested' & @CRLF)
EndFunc   ;==>DeletemeChunk

Save that somewhere and include it in your script and make use of it. The comments at the top will explain it to you (I wrote them for myself to remind me but they would help anyone). Here is a quick example I just made that uses it to pull apart my techwg youtube channel (my first original channel) and provide a list of videos on the first page.

#include <includes\chunk.au3>

Chunk(0, '<div class="yt-lockup-content">', '<div class="yt-lockup-meta">')
Chunk(0,'<a class="yt-uix-sessionlink yt-uix-tile-link  spf-link  yt-ui-ellipsis yt-ui-ellipsis-2" dir="ltr" title="', '"')
$results = Chunk('https://www.youtube.com/user/techwg/videos')
For $a in $results
    ConsoleWrite($a & @lf)
Next

Not sure if it will help you but I might as well provide it. If you can lock down areas that hold the specific files you want, or find out the format you might be able to jerry rig something so you can take information from the page and format it to construct download links for the file in the particular format that you would normally have to select from the site's interface. Not sure.

Edited by Morthawt
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...