Jump to content

how to get page source on firefox browser


Recommended Posts

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...