![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) Example: Http.ExtractMetaRefreshUrl methodDemonstrates the
Use ChilkatAx-win32.pkg Procedure Test Boolean iSuccess Handle hoHttp Handle hoSb Boolean iBCrlf String sUrl String sTemp1 Boolean bTemp1 Move False To iSuccess Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End // Sample HTML with a META refresh. // <!DOCTYPE html> // <html lang="en"> // <head> // <meta charset="utf-8" /> // <meta http-equiv="refresh" content="5; url=https://example.com" /> // <title>Meta Refresh Redirect</title> // </head> // <body> // <p>Redirecting to example.com in 5 seconds�</p> // </body> // </html> Get Create (RefClass(cComChilkatStringBuilder)) To hoSb If (Not(IsComObjectCreated(hoSb))) Begin Send CreateComObject of hoSb End Move True To iBCrlf Get ComAppendLine Of hoSb "<!DOCTYPE html>" iBCrlf To iSuccess Get ComAppendLine Of hoSb '<html lang="en">' iBCrlf To iSuccess Get ComAppendLine Of hoSb "<head>" iBCrlf To iSuccess Get ComAppendLine Of hoSb ' <meta charset="utf-8" />' iBCrlf To iSuccess Get ComAppendLine Of hoSb ' <meta http-equiv="refresh" content="5; url=https://example.com" />' iBCrlf To iSuccess Get ComAppendLine Of hoSb " <title>Meta Refresh Redirect</title>" iBCrlf To iSuccess Get ComAppendLine Of hoSb "</head>" iBCrlf To iSuccess Get ComAppendLine Of hoSb "<body>" iBCrlf To iSuccess Get ComAppendLine Of hoSb " <p>Redirecting to example.com in 5 seconds�</p>" iBCrlf To iSuccess Get ComAppendLine Of hoSb "</body>" iBCrlf To iSuccess Get ComAppendLine Of hoSb "</html>" iBCrlf To iSuccess Get ComGetAsString Of hoSb To sTemp1 Get ComExtractMetaRefreshUrl Of hoHttp sTemp1 To sUrl Get ComLastMethodSuccess Of hoHttp To bTemp1 If (bTemp1 = False) Begin Showln "The HTML has no META refresh tag." End Else Begin Showln "META refresh URL: " sUrl End End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.