jresine

Help with textarea IE, no id and no name

4 posts in this topic

Hello , I do not know how to fill the textarea : <textarea style="height: auto; overflow: hidden;" placeholder="Conversation dans general..." rows="1">

in :

<div class="channel-textarea"><div class="channel-textarea-inner"><div class="channel-textarea-upload"><input class="file-input" style="left: 0px; top: 0px; width: 100%; height: 100%; position: absolute; cursor: pointer; opacity: 0;" type="file" multiple=""></div><textarea style="height: auto; overflow: hidden;" placeholder="Conversation dans general..." rows="1"></textarea><div class="channel-textarea-emoji"><div class="sprite-item" style='background-image: url("/assets/f6c2b01391865c4cb06ab768a9f098c6.png"); background-size: 242px 110px;'></div></div></div></div><!-- react-empty: 260 --></form></div><div class="channel-members-wrap"><div class="scroller-wrap polyfill fade light"><div class="scroller channel-members"><div style="width: 100%; height: 0px; visibility: hidden;"></div>

I look at the IE functions but nothing helps.

Thank you for your help.

Share this post


Link to post
Share on other sites



Why are you trying to modify the textarea? To insert the file path?

Considering only this html sample i believe that you are trying to automate the "Input FileUpload" right? If so you cant, the only way to set the value of a file input is by the user to select a file. This is done for security reasons. Otherwise you would be able to create a Javascript that automatically uploads a specific file from the user computer.

That said, its possible to automate click in the input and them automate the window to select the file using ui automation for example.

Share this post


Link to post
Share on other sites

Hello , I do not use the upload part .

I would just complete text in this textarea , I 'm trying to create a bot for discution salon. I miss that part :)

Share this post


Link to post
Share on other sites

Try:

#include <IE.au3>

Local $sHtml = '<div class="channel-textarea"><div class="channel-textarea-inner"><div class="channel-textarea-upload"><input class="file-input" style="left: 0px; top: 0px; width: 100%; height: 100%; position: absolute; cursor: pointer; opacity: 0;" type="file" multiple=""></div>'
$sHtml &= '<textarea style="height: auto; overflow: hidden;" placeholder="Conversation dans general..." rows="1"></textarea>'
$sHtml &= '<div class="channel-textarea-emoji"><div class="sprite-item" style=''background-image: url("/assets/f6c2b01391865c4cb06ab768a9f098c6.png"); background-size: 242px 110px;''></div></div></div></div><!-- react-empty: 260 --></form></div>'
$sHtml &= '<div class="channel-members-wrap"><div class="scroller-wrap polyfill fade light"><div class="scroller channel-members"><div style="width: 100%; height: 0px; visibility: hidden;"></div>'

Local $oIE = _IECreate()
_IEDocWriteHTML($oIE, $sHTML)
Sleep(3000)

Local $oTagReturn = $oIE.document.getElementsByTagName("textarea")
If Not IsObj($oTagReturn) Then Exit ConsoleWrite("Error in $oTagReturn" & @CRLF)

ConsoleWrite("Nº of textareas: " & $oTagReturn.length & @CRLF)

$oTagReturn.Item(0).Value = "Hello!" ;if there is more than one textarea you need to change the .item(*). Its 0 based.

Exit

 

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