hamadahali Posted January 22, 2022 Posted January 22, 2022 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?
SOLVE-SMART Posted January 22, 2022 Posted January 22, 2022 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! ==> AutoIt related: 🔗 GitHub, 🔗 Discord Server Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
junkew Posted January 25, 2022 Posted January 25, 2022 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
nacerbaaziz Posted January 25, 2022 Posted January 25, 2022 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.
junkew Posted January 26, 2022 Posted January 26, 2022 (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, 2022 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
nacerbaaziz Posted January 26, 2022 Posted January 26, 2022 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))
Danp2 Posted January 26, 2022 Posted January 26, 2022 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. Latest Webdriver UDF Release Webdriver Wiki FAQs
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