Jump to content

How to get url from firefox?


unitek
 Share

Recommended Posts

  • Moderators

@unitek This forum operates on a "Teach a Man to Fish" motto, we do not spoon feed code to you. What have you tried on your own? This forum has a great search feature, and this question has been asked and answered plenty of times.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

F6 then > CTRL + C

or 

watch & learn webdriver.udf

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Moderators

@unitek I find it hard to believe you did much of a search...literally 500 pages of results

 

image.png.320244cafa6414bc9a9688cf3a99c127.png

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Old version of DDE usage...

 

$sURL = _OpenGetURL('Firefox')
ConsoleWrite($sURL & @CRLF)

Func _OpenGetURL($sServer, $sURL = "", $iWin = -1, $iRetType = 0, $iWait = 10000)
    Local $aRet, $uIdInst = DllStructCreate("int")
    Local $hServer[1], $hTopic[1], $hItem[1], $hConv[1], $hData[1], $sData[1]
    Local $sTopic = "WWW_OpenURL", $sItem = '"' & $sURL & '",,0x' & Hex($iWin)
    
    If $sURL = '' Then
        $sTopic = "WWW_GetWindowInfo"
        $sItem = "0x" & Hex($iWin)
    EndIf
    
    Local $hDll = DllOpen("user32.dll")
    If $hDll = -1 Then Return SetError(1, 0, "") ; Error to open Dll
    $aRet = DllCall($hDll, "int", "DdeInitialize", "ptr", DllStructGetPtr($uIdInst), "ptr", 0, "int", 0, "int", 0)
    If $aRet[0] Then Return SetError(2, $aRet[0], "") ; Error Initializing DDE
    $hServer = DllCall($hDll, "int", "DdeCreateStringHandle", "int", DllStructGetData($uIdInst, 1), "str", $sServer, "int", 1004)
    
    If $hServer[0] Then
        $hTopic = DllCall($hDll, "int", "DdeCreateStringHandle", "int", DllStructGetData($uIdInst, 1), "str", $sTopic, "int", 1004)
        If $hTopic[0] Then
            $hItem = DllCall($hDll, "int", "DdeCreateStringHandle", "int", DllStructGetData($uIdInst, 1), "str", $sItem, "int", 1004)
            If $hItem[0] Then
                $hConv = DllCall($hDll, "int", "DdeConnect", "int", DllStructGetData($uIdInst, 1), "int", $hServer[0], "int", $hTopic[0], "int", 0)
                
                If $hConv[0] Then
                    $hData = DllCall($hDll, "int", "DdeClientTransaction", "ptr", 0, "int", 0, "int", $hConv[0], "int", $hItem[0], "int", 1, "int", 0x20B0, "int", $iWait, "ptr", 0)
                    If $hData[0] Then $sData = DllCall($hDll, "str", "DdeAccessData", "int", $hData[0], "ptr", 0)
                EndIf
            EndIf
        EndIf
    EndIf
    
    $iErr = DllCall($hDll, "int", "DdeGetLastError", "int", DllStructGetData($uIdInst, 1))
    If $hData[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hData[0])
    If $hConv[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hConv[0])
    If $hItem[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hItem[0])
    If $hTopic[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hTopic[0])
    If $hServer[0] Then DllCall($hDll, "int", "DdeFreeDataHandle", "int", $hServer[0])
    If $iErr[0] Then Return SetError(3, $iErr[0], "") ; Other DDE Errors
    DllCall($hDll, "int", "DdeUninitialize", "int", DllStructGetData($uIdInst, 1))
    DllClose($hDll)
    
    If StringRight($sData[0], 3) = ',""' Then $sData[0] = StringTrimRight($sData[0], 3)
    If $sURL = '' Then $sURL = StringRegExpReplace($sData[0], '^"([^"]*?)".*', '"\1"')
    
    If $iRetType = 1 Then
        Local $sRetTitle = StringReplace(StringTrimLeft($sData[0], StringLen($sURL) + 1), '\"', '"')
        Local $aRetArr[3] = [$sRetTitle, $sURL, StringReplace($sData[0], '\"', '"') ]
        Return $aRetArr
    EndIf
    
    Return $sURL
EndFunc

 

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...