3 posts in this topic
I'm trying to pass values to elements in a website.
The elements are present within a table, which is again present within a table, which is inside a form.
I tried to read the form, tables, etc., but with no results. It appears to me that the elements, tables, form, etc., were not read at all.
The following is what I tried. Please guide me.
;I tried the following to read the tables into arrays #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate() _IENavigate($oIE, "---- URL HERE ----") _IELoadWait($oIE) $o_Table = _IETableGetCollection ($oIE) $i_NumTables = @extended For $i = 0 To $i_NumTables - 1 Step 1 $o_Table_Temp2 = _IETableGetCollection ($oIE, $i) $a_TableData = _IETableWriteToArray ($o_Table_Temp2) _ArrayDisplay($a_TableData) Next
;I tried the following code to pass value to the field #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate() _IENavigate($oIE, "---- URL HERE ----", 0) _IELoadWait($oIE) Local $oForm = _IEFormGetObjByName($oIE, "default") Local $oField = _IEFormElementGetObjByName($oForm, "tGroup") _IEFormElementSetValue($oField, "---- VALUE HERE ----")
The following is the html view of the website and the highlighted field is the one that I want to pass values to. Since this is an official website, I can't share the exact url.
Hi, I'm trying to find a text value inside of a html.
This is what the line looks like normally:
<p id="line1" class> <span class="bot">TEXT HERE</span> </p> The text then changes to a non breaking space:
<p id="line1" class> <span class="bot"> </span> </p> And then it changes back to normal text but it's different every time.
Can I code this so that it grabs the text every time it changes and has a variable that represents it?
I currently have this inside of my loop:
$span = .document.getElementsByTagName("span") For $text In $span If $text.value = " " Then Sleep(50) MsgBox(0,0,0) ;messagebox to test if it can be found, but I don't know how to grab the text EndIf Next The problem is that there are many other lines in the html that have the same span but are called "line3", "line5", etc and the one I need is from "line1".
I will appreciate if anyone can help with this!
Good evening everyone
Before all, I want to say that I'm doing this script to see how _IE* functions work, and see if my studs can hack a quiz I'm working on.
I want to clarify that I'm not automating any game, bypassing any CAPTCHAs, or anything that could damage anyone.
I was trying to autofill a form, based on which question is displayed.
The question is always stored in here:
<header> <h1><span class="questionid">1. </span>Here goes the question</h1> </header> And answers are stored in here:
<ul class="answers"> <li><label><span><input id="answer_0" name="answer" type="radio" value="0">Answer 1</span></label></li> <li><label><span><input id="answer_1" name="answer" type="radio" value="1">Answer 2</span></label></li> <li><label><span><input id="answer_2" name="answer" type="radio" value="2">Anwser 3</span></label></li> <li><label><span><input id="answer_3" name="answer" type="radio" value="3">Answer 4</span></label></li> </ul></fieldset></form></div> And, there are 15 questions like this.
How can automatically fill my form?
Thanks in advance
I have previously used _IEFormElementGetObjByName and _IEFormElementSetValue to enter text into a search box on a form and then submit the form.
I am now trying to enter text into a search box which is not part of a form.
Here is the HTML from the website that i'm trying to enter the data on and then submit the search.
<div class="form-group col-xs-12">
<span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_lblSearchText" for="input-search">Registreringsbeteckning</span>
<div class="input-group col-xs-12">
<span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_preSearchText" class="input-group-addon">SE -</span>
<input name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$txtSearchText" type="text" value="DTH" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_txtSearchText" class="form-control" />
<div class="form-group col-xs-12">
<label class="sr-only" for="">Sök</label>
<input type="submit" name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$btnSearch" value="Sök" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_btnSearch" class="btn btn-primary ladda-button" data-style="expand-right" />
Many thanks in advance
Hello dear community,
definitely I need external help now. I've did all 'ControlClick() - Tutorials' and read a lot of topics about interaction betweend AutoIT and external programs.
The most of them are about "Clicking a button ...". In my case it's different because I need to click a specific element within the program.
The 'program' what I am talking about is called Mendeley. It's library software for documents administration.
In the attachements in picture '1.jpg' you can see the red marked Help element.
In the picture '2.jpg' you see the context menu of the Help element. This is what I'm trying to do with the ControlClick() function.
Following I represent my code which not worked for me:
#include <MsgBoxConstants.au3> Opt("WinTitleMatchMode", 2) $hWnd = WinGetHandle("Mendeley Desktop", "") MsgBox($MB_SYSTEMMODAL, "handle check", $hWnd) ControlClick($hWnd, "Mendeley Desktop", "Help") The MsgBox tells me the number of the handle of the Mendeley window. It's not 0 so for me it means the window is recognized correctly.
When I'm execute the script the Help element is not clicked.
Any suggestions for me?