2 posts in this topic
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!
I fail trying to save content from WhatsApp other then plain text to a file that way, that non-char-content will be preserved in it's correct encoding. e.g. Emojis are spoiled.
I've tried to do so using just filewrite() as well as forcing UTF
#include <clipboard.au3> MsgBox(0,"Ready to read clipboard","Mark some WhatsApp content with non-char elements, e.g. Emojis, copy that to your clipboard (CTRL+c), then click OK here.") $ClipContent=_ClipBoard_GetData() ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ClipContent = ' & $ClipContent & @CRLF & '>Error code: ' & @error & @CRLF & "Extended: " & @extended & @CRLF) ;### Debug Console $File="C:\temp\ClipSaveToFile.txt" $h=FileOpen($File,2+8+64) ; overwrite, create path, UTF16 FileWrite($h,$ClipContent) FileClose($h) $h=FileOpen($File,64) $NeuGelesen=FileRead($h) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $NeuGelesen = ' & $NeuGelesen & @CRLF & '>Error code: ' & @error & @CRLF & StringLen ($NeuGelesen) & @CRLF ) ;### Debug Console FileClose($h) _ClipBoard_SetData($NeuGelesen) MsgBox(0,"Done","Re-read content of TEMP file was placed to the clipboard. Now paste this into WhatsApp. (Emojis will be spoiled)") I've also tried other encodings (16, 32, 64, 512)
Or what is a different, functional approach to save WhatsApp Content to File in a way, to be able to to get it back to post it back to WhatsApp?
Hello to you, dear developers!
Could you please tell me if there is an easy way to determine if the information was pasted from the clipboard?
Without any variation of the insertion via Ctrl+V, or through the context menu.
I revised the Help and many forum topics, but found nothing suitable.
Can there be any WinAPI system events that determine this event?
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