pezo89 Posted February 12, 2013 Share Posted February 12, 2013 Hello,i am trying to make a script that goes onto diffrent preset websites to look at some cloth options is availablei first thought about normal radio button check,but that was not possible asi'v found out it was based on java, and not sure how to do thathere 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 followsIf 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. Link to comment Share on other sites More sharing options...
pezo89 Posted February 13, 2013 Author Share Posted February 13, 2013 (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? expandcollapse popup;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 February 13, 2013 by pezo89 Link to comment Share on other sites More sharing options...
pezo89 Posted February 15, 2013 Author Share Posted February 15, 2013 Never mind the question above, found out that i can just use _iebodyread to verify if it is excisting or not Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now