personant Posted June 2, 2011 Posted June 2, 2011 to all the pros out there..help me! I cannot get the html sources from youtube. I would like to get the sources and save it in a html file. below are my current script #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <INet.au3> #Region $Form1 = GUICreate("Form1", 490, 122, 192, 124) $YTlink = GUICtrlCreateInput("", 24, 24, 441, 21) $Button1 = GUICtrlCreateButton("Get Source", 176, 56, 129, 41) GUISetState(@SW_SHOW) #EndRegion While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $url = GUICtrlRead($YTlink) getlink($url) EndSwitch WEnd Func getlink($url) $String = BinaryToString(InetRead($url)) FileWrite( @DesktopDir & "\source.html", $String) EndFunc Once again..help me!
sleepydvdr Posted June 2, 2011 Posted June 2, 2011 (edited) I tested your code and it works just fine. For the address you typed in, you probably was not using the FQDN sceme. Example: typing in www.yahoo.com did not work. Typing http://www.yahoo.com did work. Edited June 2, 2011 by sleepydvdr #include <ByteMe.au3>
sleepydvdr Posted June 2, 2011 Posted June 2, 2011 To compensate for people who won't know or remember, you can write a little more code that will fix that. I don't have time to test it right now, but it would go something like: $temp = StringLeft($url, 3) if $temp = "www" Then $url = "http://" & $url EndIf #include <ByteMe.au3>
personant Posted June 2, 2011 Author Posted June 2, 2011 no...even though the source file was saved on the desktop, but the file is blank.. and I still cannot get the html source
somdcomputerguy Posted June 2, 2011 Posted June 2, 2011 The posted code works fine for me too, with 'http://', that is. W/o the 'http://' prefix, the target file is created emptily.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
personant Posted June 2, 2011 Author Posted June 2, 2011 does anyone have any idea how to get the html sources from youtube?
Developers Jos Posted June 2, 2011 Developers Posted June 2, 2011 does anyone have any idea how to get the html sources from youtube? What about you post a script that can be run and doesn't work as you want? Hardcode the input and only show the needed lines of code.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
somdcomputerguy Posted June 2, 2011 Posted June 2, 2011 does anyone have any idea how to get the html sources from youtube? Your code works for that too. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
personant Posted June 2, 2011 Author Posted June 2, 2011 (edited) Your code works for that too.but the output files are blank... can't figure why Edited June 2, 2011 by personant
smartee Posted June 2, 2011 Posted June 2, 2011 ok, try this InetGet("http://www.youtube.com", @ScriptDir & "\index.html")
personant Posted June 2, 2011 Author Posted June 2, 2011 ok, try this InetGet("http://www.youtube.com", @ScriptDir & "\index.html") not working.... even the below code are not valid #include <Inet.au3> $s_URL = "http://www.youtube.com" $html = BinaryToString(InetRead($s_URL)) MsgBox(0, "", $html)
guinness Posted June 2, 2011 Posted June 2, 2011 That code is valid & I was using AutoIt V3.3.6.1 UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
smartee Posted June 3, 2011 Posted June 3, 2011 Definitely something with your system, check your firewall settings etc
personant Posted June 3, 2011 Author Posted June 3, 2011 Is is okay now... I just have to reinstall autoit. Thank goodness
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