Jump to content

Sheik

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Sheik

  1. So Autoit has to inject the above javascript into the html sourcecode of the website ? Or you mean inject script f.e. with greasemonkey and afterwards use Autoit?
  2. No, i have no glue how. Am I right, this is javascript code implemented in html? Thank you for your effort.
  3. Hello, I want to fill input fields on a website. Values are successfully written. But if an other input is clicked, the filled one is deleted. Any help #include <IE.au3> $Url = "https://www.myhermes.de/wps/portal/paket/Home/privatkunden/versenden/paket" $oIE = _IECreate($Url, 0, 1, 1, 1) ;WinWait("Paketschein erstellen - Internet Explorer",5) sleep(500) WinSetState ( "Paketschein erstellen", "", @SW_MAXIMIZE ) $oForm = _IEFormGetCollection($oIE,2) ;_IELinkClickByText($oForm,"+") $eLand="Deutschland" if $eLand<>"Deutschland" then $oSelect = _IEGetObjById($oForm, "parcelclass-cc") _IEFormElementOptionSelect ($oSelect, $eLand, 1, "byText",1) $oEvt = $oIE.document.createEvent("HTMLEvents") $oEvt.initEvent("change", True, False) $oSelect.dispatchEvent($oEvt) sleep(1000) $oForm = _IEFormGetCollection($oIE,1) for $formid in $oForm ConsoleWrite($formid.id & @CRLF); Next $oFirma = _IEGetObjById($oForm, "parcelclass-HP") _IEAction ($oFirma, "click") EndIf $oFirma = _IEGetObjById($oForm, "senderAddressLastname") _IEFormElementSetValue($oFirma, "$aNACHNAME") exit
  4. Below code worked before but not anymore. I think, this is not working anymore: $oEvt.initEvent("change", True, False) The data is written in boxes and displayed, but disappears f.e. when clicked with mouse ;below variables are filled by code before ;it contains personal data, so I post code from here $Url = "https://www.myhermes.de/wps/portal/paket/Home/privatkunden/versenden/paket" $oIE = _IECreate($Url, 0, 1, 1, 1) ;WinWait("Paketschein erstellen - Internet Explorer",5) sleep(500) WinSetState ( "Paketschein erstellen", "", @SW_MAXIMIZE ) $oForm = _IEFormGetCollection($oIE,2) ;_IELinkClickByText($oForm,"+") if $eLand<>"Deutschland" then $oSelect = _IEGetObjById($oForm, "parcelclass-cc") _IEFormElementOptionSelect ($oSelect, $eLand, 1, "byText",1) $oEvt = $oIE.document.createEvent("HTMLEvents") $oEvt.initEvent("change", True, False) $oSelect.dispatchEvent($oEvt) sleep(1000) $oForm = _IEFormGetCollection($oIE,1) for $formid in $oForm ConsoleWrite($formid.id & @CRLF); Next $oFirma = _IEGetObjById($oForm, "parcelclass-HP") _IEAction ($oFirma, "click") EndIf $oFirma = _IEGetObjById($oForm, "senderAddressLastname") _IEFormElementSetValue($oFirma, $aNACHNAME) $oFirma = _IEGetObjById($oForm, "senderAddressFirstname") _IEFormElementSetValue($oFirma, $aVORNAME) $oFirma = _IEGetObjById($oForm, "senderAddressAddition") _IEFormElementSetValue($oFirma, $aADRESSZUSATZ) $oFirma = _IEGetObjById($oForm, "senderAddressStreet") _IEFormElementSetValue($oFirma, $aSTRASSE) $oFirma = _IEGetObjById($oForm, "senderAddressHouseNumber") _IEFormElementSetValue($oFirma, $aHAUSNUMMER) $oFirma = _IEGetObjById($oForm, "senderAddressZipCode") _IEFormElementSetValue($oFirma, $aPLZ) $oFirma = _IEGetObjById($oForm, "senderAddressCity") _IEFormElementSetValue($oFirma, $aORT) $oFirma = _IEGetObjById($oForm, "senderAreaCode") _IEFormElementSetValue($oFirma, $aVORWAHL) $oFirma = _IEGetObjById($oForm, "senderPhone") _IEFormElementSetValue($oFirma, $aTELEFON) $oFirma = _IEGetObjById($oForm, "senderEmail") _IEFormElementSetValue($oFirma, $aEMAIL) $oFirma = _IEGetObjById($oForm, "receiverAddressLastname") _IEFormElementSetValue($oFirma, $eNACHNAME) $oFirma = _IEGetObjById($oForm, "receiverAddressFirstname") _IEFormElementSetValue($oFirma, $eVORNAME) $oFirma = _IEGetObjById($oForm, "receiverAddressAddition") _IEFormElementSetValue($oFirma, $eADRESSZUSATZ) $oFirma = _IEGetObjById($oForm, "receiverAddressStreet") _IEFormElementSetValue($oFirma, $eSTRASSE) $oFirma = _IEGetObjById($oForm, "receiverAddressHouseNumber") _IEFormElementSetValue($oFirma, $eHAUSNUMMER) $oFirma = _IEGetObjById($oForm, "receiverAddressZipCode") _IEFormElementSetValue($oFirma, $ePLZ) $oFirma = _IEGetObjById($oForm, "receiverAddressCity") _IEFormElementSetValue($oFirma, $eORT) $oFirma = _IEGetObjById($oForm, "receiverAreaCode") _IEFormElementSetValue($oFirma, $eVORWAHL) $oFirma = _IEGetObjById($oForm, "receiverPhone") _IEFormElementSetValue($oFirma, $eTELEFON) $oFirma = _IEGetObjById($oForm, "receiverEmail") _IEFormElementSetValue($oFirma, $eEMAIL) $oFirma = _IEGetObjById($oForm, "senderEbayAuctionNumber") _IEFormElementSetValue($oFirma, stringmid($mark,6,14)) $oFirma = _IEGetObjById($oForm, "parcelclass-HP") _IEAction ($oFirma, "click") ;$oFirma = _IEGetObjById($oIE,"send_business") ;_IEAction ($oFirma, "click") ;$oFirma = _IEGetObjById($oIE,"liabilityAccepted") ;_IEAction ($oFirma, "click") ;$oFirma = _IEGetObjById($oIE,"tocAccepted") ;_IEAction ($oFirma, "click") ;$button=_IEGetObjById($oForm,"increase0Amount") ;_IEAction($button,"click") ;$oExcel = 0 $oIE = 0 Exit Thank you for helping.
  5. No, that was not the error. But there are 2 Forms on Site and i referenced 1st instead of 2nd. Thank you anyway.
  6. yes, example code is in _IEFormElementSetValue.au3
  7. Run the _IECreate and _IEFormElement files in Examples\Helpfile directory. and study source in scite
  8. or you can use #include "array.au3" #include "excel.au3" $var = ControlGetText("[CLASS:Notepad]", "", "Edit1") ;has to exist with >=16 Lines text $sLines=StringSplit($var,@CRLF,1) _ArrayDisplay($sLines) $oExcel = ObjGet("","Excel.Application") $oExcel.Workbooks("test.xls").Activate ;has to be open _ExcelSheetActivate($oExcel, "Sheet1") ;has to exist for $r =0 to 3 for $c=0 to 3 $x=_ExcelWriteCell($oExcel, $sLines[$r*4+$c+1],$r+1 ,$c+1) ;msgbox(0,"Text",$sLines[$r*4+$c+1]) Next Next
  9. #include "IE.au3" #include "array.au3" $UsernameAndPassword = _IECreate("http://www.generate-password.com/") _IELoadWait ($UsernameAndPassword) $sText = _IEBodyReadHTML ($UsernameAndPassword) $pw=StringRegExp($sText,"value=........",3) _ArrayDisplay($pw)
  10. Please help to fill the form on the website #include <IE.au3> $Url = "http://privatpaketservice.hlg.de/wps/portal/PRIPS_DEU" $oIE = _IECreate($Url, 0, 1, 1, 1) $Url2 = "Online-Paketschein" $test = _IELinkClickByText($oIE, $Url2) $oForm = _IEFormGetCollection($oIE, 0) ;Formulardaten $aNACHNAME="Name" $oFirma = _IEGetObjById($oForm, "absender(NACHNAME)") _IEFormElementSetValue($oFirma, $aNACHNAME) $eLAND="Belgien" $oFirma = _IEGetObjById($oForm, "empfaenger(LAND)") _IEFormElementOptionselect ($oFirma, $eLAND , 1, "byText", 0) $oFirma = _IEGetObjById($oForm, "paket(p1)") _IEFormElementSetValue($oFirma, "1") ;My problem starts here: ;Source from Website: ;<input type="checkbox" name="hoechstwert_unter_500" tabindex="58" value="on" style="border-width:0px;" id="bestaetigungWertBox" alt="noImageReplacement"> $oFirma = _IEGetObjById($oForm, "hoechstwert_unter_500") msgbox(0,"ID Mir ist bekannt, ...","@error="&@error) ;error = 0 $x = _IEFormElementCheckboxSelect ($oFirma, "on", "", 1, "byValue") msgbox(0,"BOX Mir ist bekannt, ...","@error="&@error) ;error = 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type ;and is still here ;Source from Website: ;<input type="radio" value="1" alt="noImageReplacement" tabindex="57" id="mwStAusweis1" name="mwStAusweis1" $oFirma = _IEGetObjById($oForm, "mwStAusweis1") msgbox(0,"ID Ich versende als Unternehmer","@error="&@error) _IEFormElementCheckboxSelect ($oFirma, 0, "", 1, "byIndex", 0) msgbox(0,"BOX Ich versende als Unternehmer","@error="&@error)
×
×
  • Create New...