Sign in to follow this  
Followers 0
pezo89

Question regarding on how to verify radio options that is in a java script

3 posts in this topic

Hello,

i am trying to make a script that goes onto diffrent preset websites to look at some cloth options is available

i first thought about normal radio button check,but that was not possible as

i'v found out it was based on java, and not sure how to do that

here are two diffrent types with two diffrent options available

<script src="/a/j/smartmatch.js"></script>

<script language="Javascript">

TCN_makeComboGroup("SELECT___--IVORY___14");

TCN_makeSelValueGroup("");

var separator="+#+";

TCN_addContent("Small+#+55");

TCN_addContent("Medium+#+56");

TCN_addContent("Large+#+57");

TCN_reload();

setDefault();

</script>

<script src="/a/j/smartmatch.js"></script>

<script language="Javascript">

TCN_makeComboGroup("SELECT___--BLACK___14");

TCN_makeSelValueGroup("");

var separator="+#+";

TCN_addContent("Small+#+55");

TCN_reload();

setDefault();

</script>

----

what i am after is,is there a way to have my script to do as follows

If small is found, go back to excel sheet, mark it as OK if small is not found, it marks it as NO in the excel sheet.

the continue to next string for medium and so on?

In advance, thanks for any replies. :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

ok, alittle update, this is what i have gotten so far, (sorry for the "clutter" as it has been along time since i tried to write anything in autoit ^^

but the process as it stands is this:

1) it opens the Excel document, and start at row 2 , 1

2) i copys the URL, opens ie with an about:blank site, then paste navigate to the website.

3)i have made it to see if the item is in stock and write that to the Excel sheet in one spesific collum.

question is about those sizes, would i be able to read a size that is the sourcecode for example "("Large+#+57");"

and have it written in the cell $cellrow , 3 (in stock/ på lager)

or is there an easier way to have it to verify if an item is in stock or not?

;step by step
;1) Open Excel book
;2) Activate correct sheet
;3) Create Internet explorer windows with Cellvalue
;4) Focus IE,and verify that options are existing ;Check if item is still in stock, (not deleted)
;
#include <Excel.au3>
#include <IE.au3>
Local $sFilePath1 = @ScriptDir & "/Autentisering av produkter.xlsx" ;This file should already exist
Local $oExcel = _ExcelBookOpen($sFilePath1)
_ExcelSheetActivate($oExcel, "ClothingShowroom")

If @error = 1 Then
    MsgBox(0, "Error!", "Unable to Create the Excel Object")
    Exit
ElseIf @error = 2 Then
    MsgBox(0, "Error!", "File does not exist - Shame on you!")
    Exit
EndIf
$ieWindow = _IECreate("about:blank");create Main operation window
;3) and wait for it to load
For $cellrow = 2 To 5;how to make it count max rows that has something in it?
    $sCellValue = _ExcelReadCell($oExcel, $cellrow, 1)
    _IELoadWait($ieWindow);wait for operation
    _IENavigate($ieWindow, $sCellValue);Enter website from Cell $i
    _IELoadWait($ieWindow);wait for operation
    ;4)



    Local $sText = _IEBodyReadText($ieWindow)

    If StringInStr($sText, "No products match your search criteria, please try again. ") Then
        ;;; I found it

        _ExcelWriteCell($oExcel, "Ikke på lager", $cellrow, 2) ;Write to the Cell
    Else
        ;;; didn't find it
        _ExcelWriteCell($oExcel, "På lager", $cellrow, 2) ;Write to the Cell
    EndIf
Next
_ExcelBookSave($oExcel)
_ExcelBookClose($oExcel) ;Close Excel book after is done
_IEQuit($ieWindow)
Edited by pezo89

Share this post


Link to post
Share on other sites

Never mind the question above, found out that i can just use _iebodyread to verify if it is excisting or not :)

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
Sign in to follow this  
Followers 0