Sign in to follow this  
Followers 0
bastian33

Read from csv via iteration and submit forms

1 post in this topic

Hey all, n00bie here:)

I'd like to ask for your kind input on the form submitter I'm working on.

What I'm trying to do is get it to read csv (one col) row by row (URL listings), open each URL in a browser and auto fill+submit forms (same site, same form html).

So, here is what I came up with this far:

 

;Read URLs from csv via iteration and Fill+Submit a message on each URL
#include <file.au3>
#include <array.au3>

Dim $a_lines, $i, $a_temp
$s_path = 1
$rc = _FileReadToArray("C:\test.csv", $a_lines)
If $rc <> 0 Then
    For $i = 1 To $a_lines[0]
        $a_temp = StringSplit($a_lines[0], ",")
        If IsArray($a_temp) And $a_temp[0] > 0 Then
     ;Fill and submit form on each of those URLs
            Local $oIE = _IE_Example("form")
            Local $oForm = _IEFormGetObjByName($oIE, "ExampleForm")
            Local $oText = _IEFormElementGetObjByName($oForm, "textExample")
            _IEFormElementSetValue($oText, "Hey! It works!")
            _IEFormSubmit($oForm)
            WinWaitActive("Message Sent!")
        Sleep(2000)
        EndIf
    Next
EndIf
Exit

I know it's not working, but I'm lost right now, so pls help:)

 

Thanks!

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