Why won't this tool work on Newegg (It's supposed to get all elements on the page and copy them to clipboard):
Code: Select all
#NoEnv
#Warn
#SingleInstance force
SetTitleMatchMode, 2
#include <UIA_Interface>
#include <UIA_Browser>
browserExe := "msedge.exe"
if !WinExist("ahk_exe " browserExe)
Run, %browserExe%
else
WinActivate, % "ahk_exe " browserExe
Send, ^t
WinWaitActive, ahk_exe %browserExe%
cUIA := new UIA_Browser("ahk_exe " browserExe)
;cUIA.WaitPageLoad("New inprivate tab", 1000)
cUIA.Navigate("https://www.newegg.com/")
Clipboard=
Clipboard := cUIA.GetCurrentDocumentElement().DumpAll() ; Get the current document element (this excludes the URL bar, navigation buttons etc) and dump all the information about it in the clipboard. Use Ctrl+V to paste it somewhere, such as in Notepad.
ClipWait, 1
if Clipboard
MsgBox, Page information successfully dumped. Use Ctrl+V to paste the info somewhere, such as in Notepad.
else
MsgBox, Something went wrong and nothing was dumped in the clipboard!
ExitApp
- Webpage_elements.ahk 27_01_23 04⦂15⦂20⦂714 PM.jpg (103.33 KiB) Viewed 330 times
What's wrong here:
Code: Select all
#NoEnv
#Warn
#SingleInstance force
SetTitleMatchMode, 2
#include <UIA_Interface>
#include <UIA_Browser>
browserExe := "msedge.exe"
Run, %browserExe%
WinWaitActive, ahk_exe %browserExe%
cUIA := new UIA_Browser("ahk_exe " browserExe)
cUIA.Navigate("https://www.newegg.com/")
;cUIA.WaitElementExistByControlTypeandHelpText("Hyperlink", "My Account")
cUIA.FindFirstByControlTypeandHelpText("Hyperlink", "My Account").Click()
return
- TEST_2.ahk 29_01_23 06⦂31⦂52⦂181 PM.jpg (43.81 KiB) Viewed 331 times