tak09 Posted June 9, 2020 Posted June 9, 2020 how to make click actions on menu For example "ABOUT US" in the screenshot given inspect element as well please help me with that
Nine Posted June 9, 2020 Posted June 9, 2020 To start you up : Local $oIE = _IECreate("https://www.fhlbny.com/") $oTags = _IETagNameGetCollection ($oIE, "a") For $oTag in $oTags If $oTag.innerText = "ABOUT US" Then ConsoleWrite ("found" & @CRLF) ExitLoop EndIf Next $oTag.click () “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
tak09 Posted June 9, 2020 Author Posted June 9, 2020 @Nine thnks but i need the code in wd_core in chrome
Danp2 Posted June 9, 2020 Posted June 9, 2020 @tak09 If you would stick with one thread, it will allow us to better know what you are trying to do. Take a look at the function _WD_LinkClickByText. Latest Webdriver UDF Release Webdriver Wiki FAQs
tak09 Posted June 9, 2020 Author Posted June 9, 2020 @Danp2 tried but not working can u help with full ststement of _WD_LinkClickByText.
Danp2 Posted June 9, 2020 Posted June 9, 2020 @tak09 Help us to help you. Show us the code you tried and also the results from the Scite output panel. Latest Webdriver UDF Release Webdriver Wiki FAQs
tak09 Posted June 9, 2020 Author Posted June 9, 2020 #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.fhlbny.com") $lPartial = True $sText="menu-item-5075" _WD_LinkClickByText($sSession, $sText, $lPartial) Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' EndFunc Func _ChromeSetInputValueById($sSession, $Id, $Value) $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']") _WD_ElementAction($sSession, $sButton, 'value', $Value) EndFunc
Danp2 Posted June 9, 2020 Posted June 9, 2020 @tak09 Please reread my earlier post, which explains how to properly post code on the forum. It also requests that you post text and not a screenshot when possible. As far as your current issue, "menu-item-5075" is the id for a completely different element. That function is designed to search for the link's text. Therefore, you want to use something like this -- _WD_LinkClickByText($sSession, "ABOUT US") Latest Webdriver UDF Release Webdriver Wiki FAQs
tak09 Posted June 9, 2020 Author Posted June 9, 2020 @Danp2 sorry for the trouble but thanks a lot it's working Danp2 1
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