Windows 10
Hey I am trying to make simple script to solve internet test for me automatically.
I made script that works well with simple text but simetimes text is confusing. Text on both sites look the same.
There is my script
Code: Select all
VERSION BUILD=8032216
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://www.odpowiedzi.c0.pl/algorytmika_programowanie/jak_wnioskuja_maszyny.html
TAB OPEN
TAG POS=1 TYPE=H4 ATTR=* EXTRACT=TXT
SET VAR1 {{!extract}}
SET !EXTRACT NULL
TAG POS=188 TYPE=P ATTR=* EXTRACT=TXT
SET VAR2 {{!extract}}
TAB T=2
URL GOTO=https://it-szkola.edu.pl/kkurs,kurs,59,test
TAG POS=1 TYPE=TH ATTR=TXT:*{{VAR1}}*
TAG POS=R1 TYPE=LABEL FORM=ID:testForm ATTR=TXT:{{VAR2}}
Site with answers code:
Code: Select all
<h4>Question?</h4>
<p>answer</p>
<br>
Site with test:
Code: Select all
<div class="testPyt ">
<table>
<tr>
<th colspan="2">
<span class="testPytLiczFull"><span class="testPytLicz">3</span>. </span>
Question?<br /> </th>
</tr>
<tr>
<td class="testCheck"><input type="checkbox" name="idodp[830845]" id="idodp_828949_830845" value="1" /></td>
<td class="testQuest"><label for="idodp_828949_830845">ANSWER1</label></td>
</tr>
<tr>
<td class="testCheck"><input type="checkbox" name="idodp[830846]" id="idodp_828949_830846" value="1" /></td>
<td class="testQuest"><label for="idodp_828949_830846">ANSWER2</label></td>
</tr>
<tr>
<td class="testCheck"><input type="checkbox" name="idodp[830844]" id="idodp_828949_830844" value="1" /></td>
<td class="testQuest"><label for="idodp_828949_830844">ANSWER3</label></td>
</tr>
</table>
<br /><br />
</div>
Site with answers:
Code: Select all
<h4>Question about script below:<br>
<script type="text/javascript"><br>
z = 1;<br>
function a()<br>
{<br>
var z = 2;<br>
}<br>
a();<br>
alert(z)<br>
</script></h4>
<p>Answer</p>
Code: Select all
<th colspan="2">
<span class="testPytLiczFull"><span class="testPytLicz">10</span>. </span>
Co będzie wynikiem wykonania następującego skryptu:<br /><br />
<script type="text/javascript"><br />
z = 1;<br />
function a()<br />
{<br />
var z = 2;<br />
}<br />
a();<br />
alert(z)<br />
</script> </th>
Code: Select all
Error -1300: Cannot find HTML element of type "TH:" with attribute(s) "TXT:*Co będzie wynikiem wykonania następującego skryptu: <script type="text/javascript">z = Array();z.push("ABC");z.push("D");z.push("E");alert(z[1])</script>*".. Line 13: TAG POS=1 TYPE=TH ATTR=TXT:*{{VAR1}}*
Text on both sites look the same.
Is there any universal solution that work with complicated text without difficult javascript?