Jump to content

tzeus

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by tzeus

  1. I did it, the "program" works well, and could use some tweaking but it's ok. One issue i still have is sending and email using Gmail. Because gmail is all about javascript(i think), i have no way of keeping track when loading ends, so the _IEWait does not work. However i've put a sleep(3200) and so far it's pretty good. If there is a solution to this point me to it please. I would like to thank everyone for having the patience and helping me. Have a nice day!
  2. I keep being wrong somewhere. The thing is the code above works, i tested and it works. However i am unable to extract the required numbers into an loop-external array. Where do i go wrong? For $i=0 to UBound($aLinks1) - 1 $numbers = $aLinks1[$i][1] Next This always gives me: ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $numbers = $aLinks1[$i][1] $numbers = ^ ERROR I don't get it. $aLinks is like this: $aLinks[0][0] = showContact('34474726')>Bakhach, Nadim</a> $aLinks[0][1] = 18404175 $aLinks[0][2] = Bakhach, Nadim How do i extract only the number? This looks like a simple problem but i don't get it. EDIT: I managed to do it. But i still don't know why i get that error, could someone clear that for me? $numbers[$i] = $aLinks1[$i][1] == > Why is this not working ??? <- Am i not allowed to add one item to one array if it comes from a 2D array ? The way i did it is: Global $numbers[100] For $i = 0 To Ubound($aLinks1) - 1 $array = $aLinks1[$i] $numbers[$i] = $array[1] Next EndIf
  3. I didn't get to the second part yet. The first pattern is not working(not necessarily the pattern itself). Without the first i will not advance to the second part yet. So the part that is not working is the one with the showContact
  4. If i am not logged in in Iexplore, i get the login page and the array stays empty However if i am logged in Iexplore, $sStr becomes all the HTML that the $sUrl has, the array is created with 100 elements and they are all empty. The <tr> for the contact looks like this: <tr class='alt1'> <td class='tblrowLeft'> <input type='checkbox' class='checkbox' onclick='checkboxClicked()' name='ids' value='31669365' id='A_31669365' /> </td> <td class='tblrow' style='text-align:center;'> </td> <td class='tblrow nowrap' title='Chief Executive Officer'>Chief Executive Officer</td> <td class='tblrow' title='Edell, David'><span class='nowrap'/> <a href=javascript:showContact('31669365')>Edell, David</a></span> </td> <td class='tblrow' title='CCA Industries'><a class='nowrap' href='/id31765/cca_industries_company.xhtml?uid=12375093&tok=1319641896034-3215411191676879867'>CCA Industries</a></td> <td class='tblrow' title='East Rutherford'><span class='nowrap'/>East Rutherford</span></td> <td class='tblrow' title='NJ'><span class='nowrap'/>NJ</span></td> <td class='tblrow' nowrap>02/01/11</td> </tr>
  5. I don't understand why, but it's not working. I also tried to do it this way: $oIE = _IEAttach ("PAge NAme") ;$sURL = "linkHere" ;Pe prima pagina, cea cu contactele ;$sStr = BinaryToString(INetRead($sURL)) $sStr = _IEDocReadHTML($oIE) $aLinks1 = StringRegExp($sStr, "(?i)showcontact.+\x27(\d+)\x27.+?>(.+)</a>", 4) For $i = 0 To Ubound($aLinks1) ;MsgBox(0, "Result", "Number: " & $aLinks1[$i][1] & @CRLF & "Name: " & $aLinks1[$i][2]);; you can use _ArrayDisplay here instead Next _ArrayDisplay($aLinks1) MsgBox(0, "Titlu", UBound($aLinks1)) The array has 100 elements(0-99) but they are all empty. Maybe is something wrong with the reg ex ? Also, the method George provided may not work because, i can only visit the $sUrl when i am logged in, i don't know how iNet works But in both cases the array has 100 "" elements. Any insight on that?
  6. Hello, I have a web page with many links on it. I am trying to get those links into an array, and then using a loop to go and visit each one of them getting another link and populating another array. So to be exaplain. I am visiting page A, where i have a list of contact links, they have the following format: <a href=javascript:showContact('12345678')>Doe, John</a>So far i noticed the contact number to be 7-8 figures, but i think they might be even 6-9. Now i want to read every link of this format and create an array with all the links, and then getting trough every one of them, navigating to the link, getting another link there: <a href="mailto:address@goesHere.com"></a> And get all the email addresses that i will save into another array and in a file. How would a regular expression for the first and second link look like? Can anyone help me with this piece of code? I have no idea how to do it. I know i have to use some loops but i couldn't figure them out so far. Thank you
  7. Bump!
  8. Hello! I just began with AutoIt so bare with me. what i am trying to do: I want to automate some tasks, to make my work easier. I have 2 Browser windows(each on one side of the screen) The left one is a list with checkboxes and names - I cannot give you link, it's on a login basis only The right one is the gmail account. I must check the appropriate checkbox, then click the name corresponding to it(it will navigate in another page, where i can copy the e-mail address, go back to were i was before), then jump the mail window, and send an email to that address. I am not looking for free stuff, i did my search before comming here. So far i managed to switch the windows the way i like it, and i am stuck at the checkbox select thing. The problem is that, the list is a <table> All the checkboxes have the same name = "name" and random values / id's. I can not guess those, they are random. What i tried, didn't work So far my code looks like: #include <IE.au3> #include <Inet.au3> #include <Array.au3> Func ActivateEmailAddresses() If Not WinActive("Left window, email addresses", "") Then WinActivate ( "Left window, email addresses", "") EndIf EndFunc Func ActivateMail() If Not WinActive("Right Window, Mail", "") Then WinActivate ("Right Window, Mail", "") EndIf EndFunc Func SearchChkBx() $oIE = _IEAttach ("Left window, email addresses") ;attach the IExplore window to AutoIT $chkbx = _IEGetObjByName($oIE, "ids") ; get the checkbox $chkbxVal2 = $chkbx.value ; get the value of the checkbox, i will use this for the navigate link Global $values[1] ; array that holds the checkboxes values $values[0] = $chkbxVal2 ; assign first element $arr_count = UBound($values) - 2 ; used for loops _ArrayDisplay($values, "asta-i") ; test ;~ For $i = 0 to $arr_count Step 1 ;~ $arrval = $values[$i] ;~ If $chkbx.value = $arrval Then ;~ EndIf ;~ ;~ Next $i= 0 While $i <= $arr_count ; ====> What i try to do here, is to add all the verified and used values of the checkboxes, to an array, so i can use it to check the rest of them $arrval = $values[$i] If $chkbx.value <> $arrval Then $chkbxVal2 = $chkbx.value ;;===>> If the value of the checkbox is not in the array, add it, and navigate to the link _ArrayAdd($values, $chkbxVal2) $chkbx.checked = True _IENavigate($oIE, "javascript:showContact('" & $chkbxVal2 & "')") ; ==> Navigate MsgBox(0, '', $chkbxVal2) ; Test EndIf $i = $i+1 WEnd EndFunc ActivateEmailAddresses() SearchChkBx() So far i only managed to do the first checkbox. The script stops, and never checks the second. Do not worry about the navigate part back, part i have not done that yet. Baby steps ... Can anyone think of a solution for this ? Maybe i just reasoned it the wrong way and what i did has no logic... But i cannot think of a different way, not atm. Thank you. test.au3
×
×
  • Create New...