oemript Posted March 12, 2018 Author Posted March 12, 2018 (edited) Please see following image, there is an error as shown below Do you have any suggestions on what is the possible cause for this IE's error? Thanks, to everyone very much for any suggestions (^v^) Edited March 12, 2018 by oemript
Danp2 Posted March 12, 2018 Posted March 12, 2018 @oemript You have not explained why you need this information. What are you trying to accomplish? How will having this information help you reach your goal? Latest Webdriver UDF Release Webdriver Wiki FAQs
Earthshine Posted March 12, 2018 Posted March 12, 2018 Hahaha My resources are limited. You must ask the right questions
oemript Posted March 12, 2018 Author Posted March 12, 2018 (edited) Please see following reply ... Edited March 12, 2018 by oemript
oemript Posted March 12, 2018 Author Posted March 12, 2018 (edited) Status bar is "ON", error is removed, but session cannot be triggered by "focus". Please see following image Do you have any suggestions? Thanks, to everyone very much for any suggestions (^v^) Edited March 12, 2018 by oemript
Subz Posted March 12, 2018 Posted March 12, 2018 Buggered if I know why it doesn't work on your system, it works fine for me, here is my last attempt: #include <IE.au3> Local $oIE = _IECreate("https://www.lazada.com.my/catalog/?q=toys") WinSetState(_IEPropertyGet($oIE, "title"), "", @SW_MAXIMIZE) Local $oListBoxs = _IETagNameGetCollection($oIE, "div") Local $bListItems = False, $sSearch = "", $sLocationUrl = "" For $oListBox In $oListBoxs If StringInStr($oListBox.ClassName, "ant-select-selection") Then _IEAction($oListBox, "click") ControlSend(_IEPropertyGet($oIE, "title"), "", "", "{TAB 2}") $bListItems = True EndIf If $bListItems Then If $oListBox.getAttribute("data-qa-locator") ="general-products" Then $oListItems = _IETagNameGetCollection($oListBox, "a") For $oListItem In $oListItems If StringStripWS($oListItem.InnerText, 8) <> "" Then _IEAction($oListItem, "focus") ConsoleWrite("Item Information: " & @CRLF & $oListItem.InnerText & @CRLF & @CRLF & "Item Address: " & @CRLF & _IEPropertyGet($oIE, "statustext") & @CRLF) EndIf Next EndIf EndIf Next oemript 1
oemript Posted March 12, 2018 Author Posted March 12, 2018 Yes, it works, I am deeply appreciated for all your help Thanks, to everyone very much for suggestions (^v^) #include <IE.au3> Local $oIE = _IECreate("https://www.lazada.com.my/catalog/?q=toys") WinSetState(_IEPropertyGet($oIE, "title"), "", @SW_MAXIMIZE) Local $oListBoxs = _IETagNameGetCollection($oIE, "div") Local $bListItems = False, $sSearch = "", $sLocationUrl = "" For $oListBox In $oListBoxs If StringInStr($oListBox.ClassName, "ant-select-selection") Then _IEAction($oListBox, "click") ControlSend(_IEPropertyGet($oIE, "title"), "", "", "{TAB 2}") $bListItems = True EndIf If $bListItems Then If $oListBox.getAttribute("data-qa-locator") ="general-products" Then $oListItems = _IETagNameGetCollection($oListBox, "a") For $oListItem In $oListItems If StringStripWS($oListItem.InnerText, 8) <> "" Then _IEAction($oListItem, "focus") ConsoleWrite("Item Information: " & @CRLF & $oListItem.InnerText & @CRLF & @CRLF & "Item Address: " & @CRLF & _IEPropertyGet($oIE, "statustext") & @CRLF) EndIf Next EndIf EndIf Next
oemript Posted March 16, 2018 Author Posted March 16, 2018 (edited) Referring to following coding, I would like to know on how to retrieve URL from meta within View Page Sources, which name="og:url". #include <IE.au3> #include <Array.au3> #include <String.au3> #include <File.au3> Local $oIE = _IECreate("https://www.lazada.com.my/products/sokano-mini-kitchen-fun-playset-with-full-utensils-set-pink-i100636698-s100895345.html") WinSetState(_IEPropertyGet($oIE, "title"), "", @SW_MAXIMIZE) Local $oListBoxs = _IETagNameGetCollection($oIE, "meta") Local $bListItems = False, $sSearch = "", $sLocationUrl = "" Sleep(2000) For $oListBox In $oListBoxs If $bListItems Then If $oListBox.getAttribute("name") ="og:url" Then $oListItems = _IETagNameGetCollection($oListBox, "meta") For $oListItem In $oListItems If StringStripWS($oListItem.InnerText, 8) <> "" Then _IEAction($oListItem, "focus") ; How to retrieve URL from meta from View Page Sources, which name="og:url" ? Exitloop 2 EndIf Next EndIf EndIf Next _IEQuit($oIE) Do you have any suggestions? Thanks, to everyone very much for any suggestions (^v^) Edited March 16, 2018 by oemript
Danp2 Posted March 16, 2018 Posted March 16, 2018 Why so complicated? How about this -- Local $oIE = _IECreate("https://www.lazada.com.my/products/sokano-mini-kitchen-fun-playset-with-full-utensils-set-pink-i100636698-s100895345.html") $oMeta = _IEGetObjByName($oIE, 'og:url') ConsoleWrite($oMeta.GetAttribute('content') & @CRLF) oemript 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
oemript Posted March 16, 2018 Author Posted March 16, 2018 Thanks, to everyone very much for any suggestions (^v^)
oemript Posted March 18, 2018 Author Posted March 18, 2018 (edited) Please see following image, when I execute file first time without any problem, but when I execute file second time after IE closed, it pops up error message " Variable must be of type "Object" #include <IE.au3> #include <Array.au3> #include <String.au3> #include <File.au3> Local Const $sFilePath = "D:\Link.txt" Local $hFileOpen = FileOpen($sFilePath, $FO_READ) Local $sFileRead = FileReadLine($hFileOpen, 1) FileClose($hFileOpen) ;MsgBox($MB_SYSTEMMODAL, "", "First line of the file:" & @CRLF & $sFileRead) Local $oIE = _IECreate($sFileRead) $oMeta = _IEGetObjByName($oIE, 'og:url') ;ConsoleWrite($oMeta.GetAttribute('content') & @CRLF) ;MsgBox(0, "URL", StringReplace( $oMeta.GetAttribute('content') & @CRLF, "html/","html")) Local $hFileOpen = FileOpen("D:\Import.txt", 2) FileWrite($hFileOpen, StringReplace( $oMeta.GetAttribute('content') & @CRLF, "html/","html")) FileClose($hFileOpen) _IEQuit($oIE) Do you have any suggestions on what wrong it is? Thanks, to everyone very much for any suggestions (^v^) Edited March 18, 2018 by oemript
Bilgus Posted March 18, 2018 Posted March 18, 2018 See https://www.autoitscript.com/autoit3/docs/intro/ComRef.htm COM Error Handling That And What are you passing in here? Local $oIE = _IECreate($sFileRead)
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