Gyba Posted February 7, 2018 Share Posted February 7, 2018 Hello, How can I search for this string: Quote GoToRealm('pki'); If I tried the below combinations, both of them generated errors: Quote "GoToRealm(''pki'');" "GoToRealm("'pki'");" Any ideas? Thank you. Link to comment Share on other sites More sharing options...
SplashFlo Posted February 7, 2018 Share Posted February 7, 2018 Try 'GoToRealm(''pki'');' Link to comment Share on other sites More sharing options...
Gyba Posted February 7, 2018 Author Share Posted February 7, 2018 1 minute ago, SplashFlo said: Try 'GoToRealm(''pki'');' Not working Link to comment Share on other sites More sharing options...
SplashFlo Posted February 7, 2018 Share Posted February 7, 2018 2 minutes ago, Gyba said: Not working Can you post the part of the script where you seach for the string? Link to comment Share on other sites More sharing options...
Gyba Posted February 7, 2018 Author Share Posted February 7, 2018 $source = BinaryToString(InetRead('https://mypage.com', 1)) $string = StringRegExp($source, "javascript:GoToRealm('pki')", 3) For $a In $string ConsoleWrite($a & @CRLF) Next What I am trying to do is to search in a web page a button and click it. In IE developer console the button looks like this: <a class="button" style="left: 54px; background-color: rgb(153, 153, 153);" href="javascript:GoToRealm('pki');">login</a> I have 4 buttons in total, 2 of them looking very similar: <a class="button" style="left: 54px; background-color: rgb(153, 153, 153);" href="javascript:GoToRealm('pki');">login</a> <a class="button" style="left: 54px; background-color: rgb(153, 153, 153);" href="javascript:GoToRealm('pkissl');">login</a> So I cannot search for "pki" only. Link to comment Share on other sites More sharing options...
CYCho Posted February 7, 2018 Share Posted February 7, 2018 (edited) Maybe you can try this. $source = StringReplace(BinaryToString(InetRead('https://mypage.com', 1)), "'", "&squo;")$string = StringRegExp($source, "javascript:GoToRealm(&squo;pki&squo;)", 3)For $a In $string ConsoleWrite(StringReplace($a, "&squo;", "'") & @CRLF)Next Edited February 7, 2018 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 7, 2018 Moderators Share Posted February 7, 2018 Gyba, In future, do NOT hijack 11 year old threads - even if they are vaguely connected with your question. Just start a new thread as I have now done for you. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Gyba Posted February 7, 2018 Author Share Posted February 7, 2018 1 minute ago, Melba23 said: Gyba, In future, do NOT hijack 11 year old threads - even if they are vaguely connected with your question. Just start a new thread as I have now done for you. M23 Ok, I thought the opening of too many new topics might be considered spam as long as there are similar topics discussed on the forum. Will take in consideration your advice in the future. Thank you. Link to comment Share on other sites More sharing options...
Gyba Posted February 7, 2018 Author Share Posted February 7, 2018 1 hour ago, CYCho said: Maybe you can try this. $source = StringReplace(BinaryToString(InetRead('https://mypage.com', 1)), "'", "&squo;")$string = StringRegExp($source, "javascript:GoToRealm(&squo;pki&squo;)", 3)For $a In $string ConsoleWrite(StringReplace($a, "&squo;", "'") & @CRLF)Next Thanks for the suggestion. As I do this to get used to AutoIt I decided to go with the second button as it is unique on the page and easier to locate (pkissl). No my problem is: how to click it? I tried something like this: $source = BinaryToString(InetRead('https://mypage.com', 1)) $string = StringRegExp($source, "pkissl", 3) For $a In $string ConsoleWrite($a & @CRLF) Next _IELinkClickByText($source, "pkissl") It doesn't work :(. Any suggestion? As can be seen it the HTML code I provided above, this is not a regular link, it has some javascript behind. Does this matters in any way? Thank you. Link to comment Share on other sites More sharing options...
CYCho Posted February 7, 2018 Share Posted February 7, 2018 I am not an expert either. I had difficulties in reading the text of a window created by javascript. With help from this forum, I solved my problem with WebDriver. WebDriver may be a solution for you, too. You may like to take a look at below article. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment 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