I have a problem dealing with accented characters on Windows 10.
I have 2 PC: one running IE 11 and Windows 8.1, the other one running IE 11 and Windows 10 latest version
What I'm doing is to go to a specified URL, retrieve all the page links, search for a specifically labelled link and display the URL (the href). And I'm using COM objects of course
So, the code is pretty easy:
Code: Select all
IE := ComObjCreate("InternetExplorer.Application")
IE.Navigate(https epyon.pagesperso-orange.fr /test1.html" Broken Link for safety ")
IE.Visible := true
While IE.Busy
Sleep, 100
Links := IE.Document.Links
Loop % links.length {
if (links[A_Index - 1].innerText = "Lala tété") ; looking for the URL which label is "Lala tété"
{
foundUrl := links[A_Index - 1].href
MsgBox, %foundUrl%
break
}
}
Instead of strictly matching strings, I will use IfInString to do a partial match. So the new loop code would look like this:
Code: Select all
Loop % links.length {
link_text := links[A_Index - 1].innerText
search_text := "Lala"
IfInString link_text, %search_text%
{
foundUrl := links[A_Index - 1].href
MsgBox, %foundUrl%
break
}
}
Do you have any idea why, and how to make it work the way it should when a label has special accented characters?
Thanks in advance