Jump to content

Can someone help get all link from page Please


Recommended Posts

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
Link to post
Share on other sites

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

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 post
Share on other sites
14 hours ago, Mannyfresh31 said:

now edge pops up automatically instead Internet Explorer

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 ?

Link to post
Share on other sites
2 hours ago, 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 ?

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
Link to post
Share on other sites
7 hours ago, 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.

I will try 😞

Link to post
Share on other sites
18 hours ago, Mannyfresh31 said:

now edge pops up automatically instead Internet Explorer

 

3 hours ago, 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 ?

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 ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-03-17

Link to post
Share on other sites
1 hour ago, Mannyfresh31 said:

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

I just want to cry 😞

 

 

 

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

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 post
Share on other sites
11 minutes ago, caramen said:

Maybe updating edge put it again in the default used browsers.

Nah.  _IECreate open an object [ObjCreate("InternetExplorer.Application")].  It has nothing to do with default browser.

Link to post
Share on other sites

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

"I need coffee to turn me back to a human"

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

Link to post
Share on other sites
11 hours ago, 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.

@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 😞

 

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