Jump to content

Recommended Posts

Posted (edited)

OK here I go...

The script used to work but now it doesn't due to Edge update and now edge pops up automatically instead Internet Explorer

I wish I could do this with edge as I used to do with IE 

there is the script I Wrote

Someone Help Please

side note: I check Webdriver and  I'm unable to achieve it due to lack of knowledge but if someone gives me an idea maybe.

 

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;/////////Custom Library////////
#include <IE.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>

#RequireAdmin

MsgBox(0,"",IsAdmin())
#Region ### START Koda GUI section ### Form=C:\Users\Manuel\Documents\GetLinks theme.kxf
$Form1 = GUICreate("Descargar Enlaces de Youtube", 729, 228, 192, 124)
$LabelScroll = GUICtrlCreateLabel("Scrolls", 640, 75, 66, 17)
$ComboScroll = GUICtrlCreateCombo("", 640, 90, 60, 21)
 ; Add additional items to the combobox.
GUICtrlSetData($ComboScroll, "10|20|30|40|50|60|70|80|100","10")
$Input1 = GUICtrlCreateInput("", 8, 48, 489, 21)
$Button1 = GUICtrlCreateButton("Optener Enlaces", 513, 40, 103, 33)
$Input2 = GUICtrlCreateInput("", 9, 136, 487, 21)
$Button2 = GUICtrlCreateButton("Guardar", 513, 123, 103, 41)
$Label1 = GUICtrlCreateLabel("Ingrese un Canal de Videos de Youtube", 16, 16, 260, 17)
$ButtonP = GUICtrlCreateButton("Pegar", 400, 10, 80, 30)
$Label2 = GUICtrlCreateLabel("Guardar en...", 24, 112, 66, 17)
$Label3 = GUICtrlCreateLabel("0", 16, 176, 66, 17)
$Label4 = GUICtrlCreateLabel("Links/Videos", 60, 176, 76, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button1
            GetLinks ()

        Case $Button2
            Save ()

        Case $ButtonP
        GUICtrlSetData($Input1, ClipGet())




    EndSwitch
WEnd


Func Save ()
    $Name = "Mis Enlaces_" & @MON & "-" & @MDAY & "-" & @HOUR & "-" & @MIN
    $mensaje = "Elige un Lugar y Nombre para el Archivo de los Enlaces"
    Global $sFileSaveDialog =  FileSaveDialog ( $mensaje, "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "Texto (*.txt)",2,$Name,$Form1 )
    GUICtrlSetData($Input2,$sFileSaveDialog)
    EndFunc


Func GetLinks ()
    $MyURL = GUICtrlRead($Input1 )
    $MyFile = GUICtrlRead($Input2 )
    if $MyURL = "" then
        MsgBox(16,"Hey!!","Ingresa un Canal de Youtube!!!",0)
        Return
    EndIf
    if $MyFile = ""  Then
        MsgBox(16,"Hey!!","Ingresa un Lugar para Guardar el Archivo con Los Enlaces!!!",0)
        Return
    EndIf

    $MyComboRead = GUICtrlRead($ComboScroll)

    $oIE = _IECreate($MyURL,0,1,1)
    _IENavigate ($oIE,$MyURL)


Sleep(500)

Send("{TAB}")

For $scroll = 1 To $MyComboRead


    Send("{PGDN}")
    Sleep(1000)
Next

$oLinks = _IELinkGetCollection($oIE)
 $iNumLinks = @extended

 $sTxt = ""
For $oLink In $oLinks
    if StringInStr ($oLink.href, "watch?v=") then $sTxt &= $oLink.href & @CRLF
Next


$MyFileOpened = FileOpen($MyFile,2)
FileWrite($MyFileOpened,$sTxt)
FileClose($MyFileOpened)
$MyFileArray = FileReadToArray($MyFile)
GUICtrlSetData($Label3,(@extended /2))
for $i = 1 to UBound($MyFileArray) Step 1
_ArrayDelete($MyFileArray,$i)
Next

$MyFileOpened = FileOpen($MyFile,2)

For $MyLine in $MyFileArray
FileWriteLine($MyFileOpened,$MyLine )
Next
FileClose($MyFileOpened)
ShellExecute($MyFile)


EndFunc

 

Edited by Mannyfresh31
typo
Posted

I think you could learn webdriver like all of us did.

Yeah you gonna have hard time doing it depending on how you can assimilate syntax.

I'm the first to do mistake when I try to learn, but all the community is very patient and help me even when I multiple fail to understand.

Follow me.

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

  Reveal hidden contents

 

Posted
  On 2/16/2021 at 11:08 PM, Mannyfresh31 said:

now edge pops up automatically instead Internet Explorer

Expand  

That is strange.  I have both IE and Edge on Win7 and Win10.  _IECreate always bring me Explorer, never Edge.  Are you sure about that statement ?

Posted (edited)
  On 2/17/2021 at 2:08 PM, Nine said:

That is strange.  I have both IE and Edge on Win7 and Win10.  _IECreate always bring me Explorer, never Edge.  Are you sure about that statement ?

Expand  

Yes yes It brings Edge instead of IE It used to work just fine but not anymore 

I just want to cry 😞

 

 

 

Edited by Mannyfresh31
Posted
  On 2/17/2021 at 8:57 AM, caramen said:

I think you could learn webdriver like all of us did.

Yeah you gonna have hard time doing it depending on how you can assimilate syntax.

I'm the first to do mistake when I try to learn, but all the community is very patient and help me even when I multiple fail to understand.

Follow me.

Expand  

I will try 😞

Posted (edited)
  On 2/16/2021 at 11:08 PM, Mannyfresh31 said:

now edge pops up automatically instead Internet Explorer

Expand  

 

  On 2/17/2021 at 2:08 PM, Nine said:

That is strange.  I have both IE and Edge on Win7 and Win10.  _IECreate always bring me Explorer, never Edge.  Are you sure about that statement ?

Expand  

It depends sometime is  changed ... or not.

Using Edge Configuration search for "Explorer" or "compability".

 

image.thumb.png.87dd9060ecb04c77c8e159532bc1d541.png

Edited by mLipok
typo

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 2/17/2021 at 4:11 PM, Mannyfresh31 said:

Yes yes It brings Edge instead of IE It used to work just fine but not anymore 

I just want to cry 😞

 

 

 

Expand  

Maybe updating edge put it again in the default used browsers. 
You could check that maybe ? 

You have to push [Windows]+ -> Application tab -> Default applications

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

  Reveal hidden contents

 

Posted
Posted

Even though I didnt understand the language and what the buttons meant, I eventually figured it out... I also got the same result as the OP... However, with mine, it first opened iExplore then opened two windows of Edge... then it closed the iExplore and left Edge open.

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Posted
  On 2/23/2021 at 5:18 PM, Skeletor said:

Even though I didnt understand the language and what the buttons meant, I eventually figured it out... I also got the same result as the OP... However, with mine, it first opened iExplore then opened two windows of Edge... then it closed the iExplore and left Edge open.

Expand  

@Skeletor sorry I left It in Spanish my bad and yes It opens both but It doesn't do what It supposed to do "get all videos's links from YT Page" 😞 from Channel in vídeos section of course 😞

 

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...