Recently Browsing 0 members
No registered users viewing this page.
I've been using the following code for many years for the sole purpose of tracking my app usage via Google Analytics:
;GOOGLE ANALYTICS $AppStatsName = @ScriptName $GA = _IECreate("https://mywebserver/apps/stats/" & $AppStatsName & ".html", 0, 0, 0, 0) The app simply calls a blank .html page on my webserver which only contains the GA tracking code.
The $iVisible parameter is set to "0" in my case, which means the IE browser is invisible to the user.
I noticed in Windows 11, the URL is called in the Edge browser and is not invisible.
So, I wonder if anyone out there has any suggestions on calling a URL invisibly on any operating system?
This is for those pages that seem to load when you use _FFOpenURL(), but they have a text saying "please wait while we load your page..." but according to _FFOpenURL() the page has loaded. An example seen in popular sites is the Cloudflare page saying "Checking your browser before...". It's the opposite of pausing a script until an element is visible on a page. It takes Elements in the form of id, xpath or text search.
Global $BrowserPort = 4242 Global $TimeOut = 60000 Global $LocalHost = "127.0.0.1" Func _FFWaitWhileElement($thiselement, $elementtype = "xpath", $timeoutms = 60000) _FFConnect($LocalHost, $BrowserPort, $TimeOut) Local $Element Local $ElementFound = 1 Local $TimeoutCountdown = 0 While $ElementFound <> 0 And $TimeoutCountdown < $timeoutms If $elementtype = "xpath" Then $Element = _FFXPath($thiselement) EndIf If $elementtype = "id" Then Local $ConstructXPath = ".//*[@id='" & $thiselement & "']" $Element = _FFXPath($ConstructXPath) EndIf ; MsgBox(0, "", $Element) Local $ElementXPathTextContent = _FFCmd("FFau3.xpath.textContent") ; MsgBox(0, "", $ElementXPathTextContent) Local $ElementXPathInnerHTML = _FFCmd("FFau3.xpath.innerHTML") ; MsgBox(0, "", $ElementXPathInnerHTML) If $ElementXPathTextContent = "_FFCmd_Err" Or $ElementXPathInnerHTML = "_FFCmd_Err" Then $ElementFound = 0 Else $ElementFound = 1 EndIf If $elementtype = "text" Then $ElementFound = _FFSearch($thiselement) ; MsgBox(0, "", $ElementFound) EndIf $TimeoutCountdown += 1000 _FFDisConnect() _FFConnect($LocalHost, $BrowserPort, $TimeOut) WEnd Return $ElementFound EndFunc _FFConnect($LocalHost, $BrowserPort, $TimeOut) _FFOpenURL("https://www.site.com/page", True) _FFWaitForElement("Please Wait...","text", 60000) MsgBox(0,"","Page finished loading") It's pretty simple, hope it helps some of you who are working with FF.au3 :)
So I was trying to write a function that can find a button (or any other XPath Element) and scroll the page + move the mouse to the location of the button.
My logic for this was:
1. get position of button using _FFGetPosition
2. get inner dimensions of browser window and total dimensions of page
3. divide total dimensions by inner dimensions to get number of page down operations
4. use Mod() to get remaining pixels offset
5. MouseMove() and add requisite offsets for Titlebar etc (what the +5 and +54 is for in the last line)
_FFConnect($LocalHost, $BrowserPort, $TimeOut) Local $Button = _FFXPath(".//*[@id='thisbutton']") Local $ButtonPosition = _FFGetPosition($Button) Local $ElementWidth = $ButtonPosition Local $ElementHeight = $ButtonPosition Local $InnerWidth = _FFCmd("window.content.innerWidth") Local $InnerHeight = _FFCmd("window.content.innerHeight") Local $PageWidth = _FFCmd(".body.offsetWidth") Local $PageHeight = _FFCmd(".body.offsetHeight") Local $PGDNNo = Int($ElementHeight/$InnerHeight) Local $PGDNMod = Mod($ElementHeight, $InnerHeight) ; MsgBox(0,"","$ElementX: " & $ElementWidth & @CRLF & "$ElementY: " & $ElementHeight) ; MsgBox(0,"","$InnerWidth: " & $InnerWidth & @CRLF & "$InnerHeight: " & $InnerHeight) ; MsgBox(0,"","$PageWidth: " & $PageWidth & @CRLF & "$PageHeight: " & $PageHeight) ; MsgBox(0,"",$PGDNNo) ; MsgBox(0,"",$PGDNMod) Local $iter = 1 While $iter <= $PGDNNo WinActivate($BrowserWindowClass,"") _FFCmd("window.content.scrollByPages(1)") $iter += 1 WEnd MouseMove($ElementWidth + 5, $PGDNMod + 54) This isn't working. In some cases, it's not doing the page down operation the number of times needed, or not accurately pinpointing the location. I think there may be something wrong with the logic I'm using. What am I doing wrong?
Anybody could help with using QueryInterface in AutoIt to embed Microsoft Edge using WebView2 Interface ?
Here are links to information/documentation:
Image comes from: https://docs.microsoft.com/en-us/microsoft-edge/webview2/media/webview2/whatwebview.png
Introduction to Microsoft Edge WebView2
Understand WebView2 SDK versions
I'm not WindowsApi expert (QueryInterface, C++, DllCall).
What I trying to say is: It means that I do not done anything in this regards .... as so far.
2020-11-12 - Project propsed by @mLipok 2021-02-03 - First version provided by @LarsJ
I am looking to create a script which refreshes/reads a webpage every few seconds. My goal is to see if the page has changed, then I will send myself a notification that the webpage has been updated.
However, rather than downloading the entire webpage every single time, is there a way to check when the webpage last updated?
If not, is there away to partially download/read html source until a specific tag is hit?
Goal: I would like to increase my poll rate and not excessively waste data.