hamadahali 0 Posted January 22 Share Posted January 22 Firefox, sourcehello guys, please i need to get a source of internet page from the firefox. i tried the ff.au3 but it requires mozreper, which it does not support the latest firefox versions. please is there any other way to do that? Link to post Share on other sites
SOLVE-SMART 25 Posted January 22 Share Posted January 22 Hi hamadahali, there are several ways to do that. Did you try to search for a solution in the forum or on other sites like stackoverflow etc.? Please share your code how you tried to use ff.au3. Please give us more details of what you try to achieve Do you want the whole source code or texts of specific elements of the page or something else? Which page is it etc.? Is there a page login needed? Depending on your answers, you can use: InetGet() InetRead() Or http requests with or without token or WebDriver automation etc. Best regards Sven ________________Stay innovative! Link to post Share on other sites
junkew 468 Posted January 25 Share Posted January 25 sendkeys / controlsettext /uia setvalue in the addressbar below piece of code and it will popup the innerhtml or any other information you can retrieve with javascript javascript:alert(document.body.innerHTML) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to post Share on other sites
nacerbaaziz 15 Posted January 25 Share Posted January 25 hello guys am also trying to do that with firefox the ff.au3 require the addon to be installed and the addon does not support the latest firefox version can anyone please give us an example about how to do that using the web driver or any other way i tried to use the send function to press ^u but it does not work as I want. Link to post Share on other sites
junkew 468 Posted January 26 Share Posted January 26 (edited) Quote can anyone please give us an example about how to do that using the web driver webdriver start reading here https://www.autoitscript.com/wiki/WebDriver and here Edited January 26 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to post Share on other sites
nacerbaaziz 15 Posted January 26 Share Posted January 26 hello again i did that it will open a firefox page and give the source but what if i have a page opened before i run the example and i wanted to get it source can any one show us how that will be #include "wd_helper.au3" #include "wd_capabilities.au3" _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) ;~ Local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'firefox') _WD_CapabilitiesAdd('browserName', 'firefox') _WD_CapabilitiesAdd('acceptInsecureCerts', True) _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() _WD_Startup() _WD_ConsoleVisible(False) $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.autoitscript.com/forum/topic/207406-how-to-get-page-source-on-firefox-browser/") _WD_LoadWait($sSession) MSGBox(64, "source", _WD_GetSource($sSession)) Link to post Share on other sites
Danp2 1,227 Posted January 26 Share Posted January 26 1 hour ago, nacerbaaziz said: but what if i have a page opened before i run the example and i wanted to get it source can any one show us how that will be See my recent answer here. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
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