Jump to content

Estimate <h2> tags or text of submits of the following IEpages


 Share

Recommended Posts

Sorry,

I've another question to IE.au3. If I opening a webside, filling out a form and if I uploading a file, there will buildt up different websites as result of my uploads. For example:

  • a) a page with the successfully uploaded pictures( Okay - that's no problem ;-))
  • :) a page, (with the same title of the windows as before, but with different content that tells me, that a picture with this name already existing.
  • c) a page with is telling me, that the server is too busy, that I should start my uploads a little later
And now my questions:

How can I recognize these pages per the heading tags <h2> or per the text of their submit buttons?

`

I've tried some versions of _IETagNameAllGetCollection() and _IETagNameGetCollection(), but I've got the impression that the give me only information of the start page, not of the following page. In the case of :D they gives me only the 'old' state of submit button of the start page not of the following page.

In case :D I send you source code of the first and the second page(criteria of differences): Johannes

* (1.page) no <h2>tags | (2.page line 67) <h2> Warnung</h2>

* (1.page line 159) <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' /> |

(2.page line 71)<input type='hidden' name='wpIgnoreWarning' value='1' />

$oIE = _IECreate('http://de.wikipedia.org/wiki/Spezial:Hochladen'); call a webpage
WinWait('Hochladen', '')
WinSetState('Hochladen', '', @SW_MAXIMIZE); maximaze the webpage
$iVisibleHeight = $oIE.document.body.clientHeight
$oIE.document.parentwindow.scrollBy (0, $iVisibleHeight); scroll down the webpage
$oForm = _IEFormGetObjByName($oIE, 'Upload')
;********* fill out the form with the help of an ini-file (THIS WORKS FINE)**********************
$oInputFile = _IEFormElementGetObjByName($oForm, "wpUploadFile")
_IEAction($oInputFile, "focus")
If @OSTYPE = 'WIN32_NT' And GUICtrlRead($c13) = $GUI_CHECKED Then BlockInput(1);klö
$lese = IniRead(@ScriptDir & '\wikfeder.ini', $i, 'Pfad', 'Fehler')
Send($lese)
If @OSTYPE = 'WIN32_NT' And GUICtrlRead($c13) = $GUI_CHECKED Then BlockInput(0)
$oQuery1 = _IEFormElementGetObjByName($oForm, 'wpDestFile')
_IEFormElementSetValue($oQuery1, IniRead(@ScriptDir & '\wikfeder.ini', $i, 'Dateiname', 'Fehler'))
$aEL = StringSplit('Beschreibung|Quelle|Seite|Urheber|Datum|Genehmigung|Andere Versionen|Anmerkungen', '|')
$sDesc = '{{Information' & @CRLF
For $j = 1 To $aEL[0]
    $sDesc = $sDesc & '|' & $aEL[$j] & '=' & IniRead(@ScriptDir & '\wikfeder.ini', $i, $aEL[$j], 'Fehler') & @CRLF
Next
$sDesc = $sDesc & '}}'
$oQuery3 = _IEFormElementGetObjByName($oForm, 'wpUploadDescription')
_IEFormElementSetValue($oQuery3, $sDesc)
$oSelect = _IEFormElementGetObjByName($oForm, 'wpLicense')
_IEFormElementOptionselect($oSelect, IniRead(@ScriptDir & '\wikfeder.ini', $i, 'GenehmigungII', 'Fehler'), 1, 'byText')
If IniRead(@ScriptDir & '\wikfeder.ini', $i, 'Seite beobachten', 'Fehler') = 4 Then
    $Watch = 0
Else
    $Watch = 1
EndIf
_IEFormElementCheckBoxSelect($oForm, 'wpWatchthis', '', $Watch, 'byIndex')
;********** End of filling out the form *****************************************
$oSubmit = _IEGetObjByName($oIE, "wpUpload")
_IEAction($oSubmit, "click")   ;uploading picture
_IELoadWait($oIE)

$iWait = Round((FileGetSize(IniRead('D:\reswikfeder\wikfeder.ini', $i, 'Pfad', 'fehler')) / 1024) / 1.32)
; $iWait is the loading time for analog internetconnection min 20 kbit/per second
If $iWait < 10 Then $iWait = 10
$errWinWait = WinWait('Bild:', '', $iWait) ;normaly a webpage with the successfully uploaded picture appears
Edited by jlorenz1

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Link to comment
Share on other sites

$oIE as obtained by _IECreate or _IEAttach is a reference to the browser object rather than to the document contained in it. Most IE.au3 functions operate on documents and their contents rather than the browser, but the functions are written to take a browser object and automatically drill into the current document for you -- in this way you can get the original $oIE object and continue to use it even though the document inside is changing over time. In other words, in almost all cases, the functions will be working with the currently displayed document, not the originally displayed document.

If you continue to have trouble I'd suggest taht you simplify the posted script so that it is easier to focus on the question you are asking rather than having to weed through all of the other stuff as well (like the ini file processing).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

$oIE as obtained by _IECreate or _IEAttach is a reference to the browser object rather than to the document contained in it. Most IE.au3 functions operate on documents and their contents rather than the browser, but the functions are written to take a browser object and automatically drill into the current document for you -- in this way you can get the original $oIE object and continue to use it even though the document inside is changing over time. In other words, in almost all cases, the functions will be working with the currently displayed document, not the originally displayed document.

If you continue to have trouble I'd suggest taht you simplify the posted script so that it is easier to focus on the question you are asking rather than having to weed through all of the other stuff as well (like the ini file processing).

Dale

Hi Dale, thanks for your patience. Simplified it is this:

;(page title:"'http://de.wikipedia.org/wiki/Spezial:Hochladen"   <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />)
$oIE = _IECreate('http://de.wikipedia.org/wiki/Spezial:Hochladen'); call a webpage
$oSubmit = _IEGetObjByName($oIE, "wpUpload")
_IEAction($oSubmit, "click")
;(Next page title:"'http://de.wikipedia.org/wiki/Spezial:Hochladen"  State now: <input type='hidden' name='wpIgnoreWarning' value='1' />)

How can I get the new state of "wpIgnoreWarning"? Johannes

Edited by jlorenz1

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Link to comment
Share on other sites

Hi Dale, thanks for your patience. Simplified it is this:

;(page title:"'http://de.wikipedia.org/wiki/Spezial:Hochladen"   <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />)
$oIE = _IECreate('http://de.wikipedia.org/wiki/Spezial:Hochladen'); call a webpage
$oSubmit = _IEGetObjByName($oIE, "wpUpload")
_IEAction($oSubmit, "click")
;(Next page title:"'http://de.wikipedia.org/wiki/Spezial:Hochladen"  State now: <input type='hidden' name='wpIgnoreWarning' value='1' />)oÝ÷ Øz0q©ÈëméÞÂËZµêªê- ÞYªçx*ºI¢§ë?ªê-xxjW¶¸vØb³­©Î}ùbìnÈ­y«­¢+Ø¥¹±Õ±Ðí%¹ÔÌÐì(ÀÌØí½%ô}%
ÉÑ ÅÕ½Ðí¡ÑÑÀè¼½¹Ý¥­¥Á¥¹½É½Ý¥­¤½MÁ饰é!½¡±¸ÅÕ½Ðì°À°À¤(ÀÌØí½±µ¹ÑÌô}%Q9µ±±Ñ
½±±Ñ¥½¸ ÀÌØí½%¤)½ÈÀÌØí½±µ¹Ð%¸ÀÌØí½±µ¹ÑÌ(%ÀÌØí½±µ¹Ð¹Ñ¹µôÅÕ½Ðí ÈÅÕ½ÐìQ¡¸5Í ½à À°ÅÕ½Ðí±µ¹Ð%¹¼ÅÕ½Ðì°ÅÕ½ÐíQ¹µèÅÕ½ÐìµÀìÀÌØí½±µ¹Ð¹Ñ¹µµÀì
HµÀìÅÕ½Ðí¥¹¹ÉQáÐèÅÕ½ÐìµÀìÀÌØí½±µ¹Ð¹¥¹¹ÉQáФ)9á

And I got no MsgBox, even there is a <h2> tag in the html source. <h3> is working fine with this script. And how can I get the text of the submit buttons in this offline - page ?? Johannes

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Link to comment
Share on other sites

Hallo Dale,

If I use tagname="ul" I'll get definitly the informations of the first page, even the second page is only loaded. Johannes

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Link to comment
Share on other sites

Sorry Dale, it works. My mistake was working with an Offlinepage.. This topic can be closed. Johannes

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

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