Jump to content

Where is the problem ? please help me


Go to solution Solved by SmOke_N,

Recommended Posts

  • Moderators

CemalSenturk,

I have also deleted your second attempt at a CemalSenturk1 account - if you create a third new account you will be permanently removed from the community. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

 

CemalSenturk,

I have also deleted your second attempt at a CemalSenturk1 account - if you create a third new account you will be permanently removed from the community. :naughty:

M23

 

Sorry for breaking the rules.. I will be more careful next time o:)

 

There are multiple forms on the webpage. You could try something like this:

Local $oForms = _IEFormGetCollection($oIE)
For $oForm In $oForms
    If $oForm.Action = '/classifieds/tractors/edit/5121406/#details' Then
        _IEFormSubmit($oForm)
        ExitLoop
Next

Edit: The following appears to get a direct reference to the form without the looping --

Local $oDiv = _IEGetObjById($oIE, "details")
$oForm = _IETagNameGetCollection($oDiv, "form", 0)

 

And here I tried both of the codes you wrote but nothing happened..

Also I tried this but nothing happens..

Local $oDiv = _IEGetObjById($oIE, "details")
$oForm = _IETagNameGetCollection($oDiv, "form", 0)
_IEAction ($oForm, "click") ;tried with " _IEAction ($oDiv, "click") " but no :(
Link to comment
Share on other sites

 

You need to think this through. Once you have a reference to the form, what is it that you are trying to do? Click on it (the form)? No, I don't think so. Did you try:

Local $oDiv = _IEGetObjById($oIE, "details") 
$oForm = _IETagNameGetCollection($oDiv, "form", 0)
_IEFormSubmit($oForm)

 

Thank you so much! This code works! Have a good day man you are awesome :)

Link to comment
Share on other sites

Yeah.. worked for twice but now causing error..

#include <IE.au3>

Call ("SignIn")

Func SignIn()
Local $oIE, $oForm, $oText

$oIE = _IECreate ("http://www.car.gr/users/login")
$oForm = _IEFormGetCollection ($oIE, 1)

$oText = _IEFormElementGetObjByName($oForm, "username")
_IEFormElementSetValue($oText, "---")

$oText = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oText, "---")
sleep(500)
_IEFormSubmit($oForm)
sleep(1000)
_IENavigate($oIE, "http://www.car.gr/classifieds/tractors/edit/5121406/#details")

Local $oDiv = _IEGetObjById($oIE, "details")
$oForm = _IETagNameGetCollection($oDiv, "form", 0)
_IEFormSubmit($oForm)

sleep(2000)
ProcessClose("iexplore.exe")
EndFunc

 and here is errors >_<

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3"    
--> IE.au3 T3.0-0 Error from function _IENavigate, $_IEStatus_COMError (-2147352567)
--> IE.au3 T3.0-0 Warning from function _IEGetObjById, $_IEStatus_NoMatch (details)
--> IE.au3 T3.0-0 Error from function _IETagNameGetCollection, $_IEStatus_InvalidDataType
--> IE.au3 T3.0-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType
>Exit code: 0    Time: 5.299

Previously to switch tabs* I used _IENavigate. Maybe there is the problem??

Edited by CemalSenturk
Link to comment
Share on other sites

OS: Windows 7 64-Bit Ultimate
AutoIt Version 3.4.1

IE Version 11.0.9600.17358

Now I use sleep only between _IEFormElementSetValue($oText, "my pass here") and submit button and runs nicely without error until this code comes.
 
Local $oDiv = _IEGetObjById($oIE, "details")
$oForm = _IETagNameGetCollection($oDiv, "form", 0)
_IEFormSubmit($oForm)

Sometimes works but sometimes causes error. Can we use mouse to scroll down and click the button's x,y coordinates ?

Link to comment
Share on other sites

FWIW, 3.4.1 sounds like your Scite version. You are probably using 3.3.12.0 or later. I suspect that this issue is caused by the IE object being destroyed whenever you navigate to a new page. Try the following:

#include <IE.au3>

SignIn()
DoStuff()
SignOut()

Func SignIn()
Local $oIE, $oForm, $oText

$oIE = _IECreate ("http://www.car.gr/users/login")
$oForm = _IEFormGetCollection ($oIE, 1)

$oText = _IEFormElementGetObjByName($oForm, "username")
_IEFormElementSetValue($oText, "---")

$oText = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oText, "---")
_IEFormSubmit($oForm)
EndFunc

Func DoStuff()
Local $oIE, $oDiv, $oForm

$oIE = _IEAttach("5121406")

If IsObj($oIE) Then
    _IENavigate($oIE, "http://www.car.gr/classifieds/tractors/edit/5121406/#details")

    $oDiv = _IEGetObjById($oIE, "details")
    $oForm = _IETagNameGetCollection($oDiv, "form", 0)
    _IEFormSubmit($oForm)
EndIf

EndFunc

Func SignOut()
Local $oIE = _IEAttach("5121406")

If IsObj($oIE) Then
    _IEQuit($oIE)
EndIf

EndFunc
Link to comment
Share on other sites

AutoIt Version : v3.3.12.0

Navigate didn't worked. I'm still on default page.
 

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3"
--> IE.au3 T3.0-0 Warning from function _IEAttach, $_IEStatus_NoMatch
--> IE.au3 T3.0-0 Warning from function _IEAttach, $_IEStatus_NoMatch
>Exit code: 0 Time: 1.999
Link to comment
Share on other sites

$oIE = _IEAttach("car.gr", "url")

Yes that worked I'm in the navigated page but no button clicks :(

Errors..

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\THE-WALKING\Desktop\tutorial.au3"
--> IE.au3 T3.0-0 Warning from function _IELoadWait, $_IEStatus_LoadWaitTimeout
--> IE.au3 T3.0-0 Error from function _IEGetObById, $_IEStatus_InvalidObjectType
--> IE.au3 T3.0-0 Error from function _IETagNameGetCollection, $_IEStatus_InvalidDataType
--> IE.au3 T3.0-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType
--> IE.au3 T3.0-0 Warning from function _IEAttach, $_IEStatus_NoMatch
>Exit code: 0 Time: 302.8

There isn't errors while running normally, but I have issues about my internet connection because of that here is error.

Edited by CemalSenturk
Link to comment
Share on other sites

And lol I just deleted advertisement by mistake changing the IECreate url :( My Idea was to create #details page directly.

Local $oIE, $oForm, $oText

$oIE = _IECreate ("http://www.car.gr/classifieds/tractors/edit/4883230/#details")
$oForm = _IEFormGetCollection ($oIE, 1)

$oText = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oText, "---")
_IEFormSubmit($oForm)

Write the password and no need for navigate command.

Now just need to figure out how to click that button without deleting the advertisement :x

Edited by CemalSenturk
Link to comment
Share on other sites

Cernal,

This forum isn't designed for you to outsource the development of your script. We are here to offer assistance, and I feel that I have already given you all of the necessary code to accomplish your described task. At this point, you need to write the complete script and then run it. If it doesn't work, then show us the code and give specific details to describe where it is failing.

Hint: you probably should add some debugging code (see either ConsoleWrite or see the option Add Trace Lines under the Scite Tools menu) so that it will be easier for others to assist with debugging the code.

Dan

Link to comment
Share on other sites

This code instead of clicking Save Button, affects Delete button.

#include <IE.au3>

SignIn()
DoStuff()
SignOut()

Func SignIn()
Local $oIE, $oForm, $oText

$oIE = _IECreate ("http://www.car.gr/classifieds/tractors/edit/5927920/#details")
$oForm = _IEFormGetCollection ($oIE, 1)

$oText = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oText, "---")
_IEFormSubmit($oForm)
EndFunc

Func DoStuff()
Local $oIE, $oDiv, $oForm

If IsObj($oIE) Then
$oDiv = _IEGetObjById($oIE, "details")
$oForm = _IETagNameGetCollection($oDiv, "form", 0)
_IEFormSubmit($oForm)
EndIf

EndFunc

Func SignOut()

If IsObj($oIE) Then
_IEQuit($oIE)
EndIf

EndFunc

Here is the save and delete button's sources:

<div class="tab-content">
<div class="tab-pane active" id="delete">
    <h2>Delete</h2>
    <form id="delete_form" action="/classifieds/tractors/delete/5929826/" method="post">
        <input type="checkbox">
        <button type="submit" class="btn btn-danger" disabled="disabled">
        <i class="fa fa-trash-o">
            ::before</i>
        </button>
    </form>
</div>
<div class="tab-pane" id="photos">...</div>
<div class="tab-pane active" id="details">
<h2>Details></h2>
<form class="form-horizontal"
action="/classifieds/tractors/edit/5121406/#details"
method="post">
<input name="dealer_id" type="hidden" value=""></input>
<fieldset>...</fieldset>
<fieldset>...</fieldset>
<fieldset>...</fieldset>
<fieldset>...</fieldset>
<fieldset>...</fieldset>
<fieldset>...</fieldset>
<fieldset>...</fieldset>
<fieldset>...</fieldset>
<p class="alert alert-warning"</p>
<fieldset>...</fieldset>
<div class="form-actions">
<button class="btn btn-primary" type="submit">Save Changes</button>
</div>
</form>
</div>
<div class="tab-pane" id="statistics">...</div>
<div class="tab-pane" id="reports">...</div>
<div class="tab-pane" id="trading">...</div>
<div class="tab-pane" id="preview">...</div>
</div> 

Any Ideas how to click Save Button without clicking Delete button?

Edited by CemalSenturk
Link to comment
Share on other sites

#include <IE.au3>

SignIn()
DoStuff()
SignOut()

Func SignIn()
Local $oIE, $oForm, $oText

$oIE = _IECreate ("http://www.car.gr/classifieds/tractors/edit/5934173/#details")
$oForm = _IEFormGetCollection ($oIE, 1)

$oText = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oText, "---")
_IEFormSubmit($oForm)
EndFunc

Func DoStuff()
Local $oIE, $oDiv, $oForm

$oIE = _IEAttach("5934173")

If IsObj($oIE) Then
_IENavigate($oIE, "http://www.car.gr/classifieds/tractors/edit/5934173/#details")

$oDiv = _IEGetObjById($oIE, "details")
$oForm = _IETagNameGetCollection($oDiv, "form", 2)
_IEFormSubmit($oForm)
EndIf

EndFunc

Func SignOut()
Local $oIE = _IEAttach("5934173")

If IsObj($oIE) Then
_IEQuit($oIE)
EndIf

EndFunc 

code is here and tried with form 0,1,2 keeps deleting..

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...