Jump to content

Recommended Posts

zxtnt09

Hi again,

i have one question ! ,

how we can use a "inetread" without any changes in doc,

it's meant : 

for example in this address we have this source : (Address : http://example.com)

<!doctype html> <!-- i have <br/> ( Enter ) -->
<html> <!-- i have enter too -->
    <head> <!-- i have too -->
        <title>i am in autoit :) </title>
        <meta charset="utf-8">
    </head>
    <body>
        <p> i want to go in autoit :( </p>
        <a href="http://autoitscript.com">autoit</a>
    </body>
</html>

in this source you see many "Enter", now how we can have this (source) by "inetread" or "inetget" or something like that,

i try to use that with "inetread" but it have not any "enter"!

thanks alot :ILA2:

*sorry for my many questions,

Edited by zxtnt09

Share this post


Link to post
Share on other sites
zxtnt09

Don't worry about it, I could not understand a single one.

i need return "exactly" source code from WebSite,

it's meant if in source have any "enter" ( break to next line ) , etc. i need that.

for example : if we have some thing like that from web , i want that : 

**** ****
***   ***
**     **
*       *
*       *
**     **
***   ***
**** ****

Retrun msgbox(1,"it was from website",$fromWebSite)

Edited by zxtnt09
MsgBox

Share this post


Link to post
Share on other sites
zxtnt09

What is the code you tried and the website?

Local $dData = InetRead("http://example.com/")
Local $sData = BinaryToString($dData, 4)

$editbox = GUICtrlCreateEdit($sData, 230, 55, 570, 599,$ES_AUTOVSCROLL + $WS_VSCROLL + $CBS_DISABLENOSCROLL,-1)

it should echo something like that : 

'<!doctype html>' & @CRLF & _
'<html>' & @CRLF & _
'<head>' & @CRLF & _
'<title>Home Page</title>' & @CRLF & _
'<meta charset="UTF-8">' & @CRLF & _
'</head>' & @CRLF & _
'<body>' & @CRLF & _
'<p> This Is Paragraf </p>' & @CRLF & _
'</body>' & @CRLF & _
'</html>'

HTML CODE : 

<!doctype html>
<html>
<head>
<title>Home Page</title>
<meta charset="UTF-8">
</head>
<body>
<p> This Is Paragraf </p>
</body>
</html>

i need HTML Code ! :'(

Edited by zxtnt09
html

Share this post


Link to post
Share on other sites
zxtnt09

The url is not working for me.

it is example domain, 

nvdt6r.png

if you "right click" > inspect elemetns > 

you can see the "html" code, 

i want that ! 

Edited by zxtnt09

Share this post


Link to post
Share on other sites
JohnOne
Local $dData = InetRead("http://example.com/")
Local $sData = BinaryToString($dData, 4)

ConsoleWrite($sData & @LF)

I get...

<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
    body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
        
    }
    div {
        width: 600px;
        margin: 5em auto;
        padding: 50px;
        background-color: #fff;
        border-radius: 1em;
    }
    a:link, a:visited {
        color: #38488f;
        text-decoration: none;
    }
    @media (max-width: 700px) {
        body {
            background-color: #fff;
        }
        div {
            width: auto;
            margin: 0 auto;
            border-radius: 0;
            padding: 1em;
        }
    }
    </style>    
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.</p>
    <p><a href="http://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>

I've know Idea why a basic function like that would not work.

  • Like 1

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
JohnOne

Try this to force a reload.

Local $dData = InetRead("http://example.com/", 1)
Local $sData = BinaryToString($dData, 4)

ConsoleWrite($sData & @LF)

or this

Local $dData = InetRead("http://example.com/", 1)
Local $sData = BinaryToString($dData)

ConsoleWrite($sData & @LF)

 

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Melba23

zxtnt09,

The InetGet call is returning the data with a simple "0x0A" for EOL - this works for a ConsoleWrite but not in an Edit control. To correctly display there you need to convert this to the standard Windows "0x0D0A":

#include <GUIConstantsEx.au3>

$dData = InetRead("http://example.com/")
$sData = BinaryToString(StringReplace($dData, "0A", "0D0A"), 4)

$hGUI = GUICreate("Test", 500, 500)

$cEdit = GUICtrlCreateEdit($sData, 10, 10, 400, 400)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

  • Like 1

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
zxtnt09
<snip>

Oops,

consolewrite, 

it was something like "console.log" in node.js ... haha

thanks alot:wub:

Edited by Melba23
Removed large quote

Share this post


Link to post
Share on other sites
Melba23

zxtnt09,

When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - we know what we wrote and it just pads the thread unnecessarily.

M23

 

  • Like 1

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
zxtnt09

JohnOne = thanks alot for your fast replay

Melba23 = sorry <3 & thanks for more info :wub:

 

Share this post


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

  • Similar Content

    • nooneclose
      By nooneclose
      I am sure you guys know of a simple solution but I am still kind of new to AutoIt and its special functions. I want my code to be able to know how to encrypt and decrypt "A" and "a" as two different chars.
      my code is very long so here is just a snippet/example of it.  
      ;Encode== Global $charAA = "" ; ( Capital letter A ) = Global 184 = ¸ ( Cedilla ) $charAA = $charAA & Chr(65) Global $chara = "" ; ( Lowercase letter a ) = Global 251 = û ( û Latin Small Letter U With Circumflex ) $chara = $chara & Chr(97) ;Decode== Global $ch184 = "" ;( Copyright symbol ) = $charAA $ch184 = $ch184 & Chr(184) Global $ch251 = "" ;( û Latin Small Letter U With Circumflex ) = $chara $ch251 = $ch251 & Chr(251) ;Encode== stringreplace($test_String, $charAA, $ch184) stringreplace($test_String, $chara, $ch251) ;Decode== stringreplace($$new_String, $ch184, $charAA) stringreplace($$new_String, $ch251, $chara) ( NOTE: my stringreplace function is nested in my actual code. I only separated them here for readability. )

      I know there are better ways to Encrypt and Decrypt a message but I'm doing this as a fun side project for me and a select group of friends to enjoy. 
      Again My code is not encrypting or decrypting capitals and lower case properly even though I use their ANSI codes. 
       
      Example: Input "A a B b"  Encrypt: ". . $ $"  Decrypt: "A A B B"
      Any and all help will be greatly appreciated.  
    • Simpel
      By Simpel
      Hi,
      I'm trying to replace line breaks. But when there are two or more of them keep them. At the end it should reformat copied text with unwanted line breaks. This is my code:
      #include <MsgBoxConstants.au3> ;~ Local $sText = ClipGet() Local $sText = "asd" & @CRLF & "asd" & @CRLF & "asd" & @CRLF & "asd" & @CRLF & "asd" & @CRLF & @CRLF & "asd" & @CRLF & "asd" & @CRLF & "asd" & @CRLF & "asd" & @CRLF & "asd" & @CRLF & @CRLF & "asd" MsgBox($MB_TOPMOST, "Original", $sText) Local $sRegexKillEnters = "(?m)(?<=\V)\v(?!\v|\h\h|\t)" ; (first all but Enter)Enter(but not if Enter or 2 Spaces or a Tab - if one wrote a list) $sText = StringRegExpReplace($sText, $sRegexKillEnters, " ") MsgBox($MB_TOPMOST, "Kill Enters", $sText & @CRLF & @CRLF & "Extended: " & @extended) I would expect:
      asd asd asd asd asd asd asd asd asd asd asd but get no error code and this:
      asd asd asd asd asd asd asd asd asd asd asd It works at regex101.com with flavour pcre: https://regex101.com/r/aTmV2T/1 but @AZJIO RegExp-Tester gives @Extended = 11.
      What is my mistake? Simpel
    • Blueman
      By Blueman
      Hi all,
      I was wondering if you can help me with the function called; InetRead().
      My scripts are using this function a lot for several conditions and everything works fine!
      But sometimes when the server is a little bit buggy of simply not available my script is hanging.
      It takes about 90sec before this function returns a Timeout, when i adjust the parameter it still is hanging about 90sec.
      The following script is a example where the script is hanging for aprox. 90sec;
      ; Set Timeout to 2sec AutoItSetOption ("TCPTimeout", 2000) ; Read Website InetRead("http://www.geenverbinding.nl/",1) ; Show Msgbox before Ending Script. Msgbox(64,"","Finished")  
      The following script is a example where the script show the Msgbox pretty fast;

       
      ; Set Timeout to 2sec AutoItSetOption ("TCPTimeout", 2000) ; Read Website InetRead("http://www.google.nl/",1) ; Show Msgbox before Ending Script. Msgbox(64,"","Finished")  
      My question now is, what am i doing wrong and/or is there a other way to prevent Hanging the script?
      Thanks all
       
    • 31290
      By 31290
      Hi everyone, hope you are doing fine
      Well, I'm currently writing a small script that goes to a certain web page, finds the first link of a specified section and download the file associated to this link.
      Depending on the computer that the tool is launched, the script gets the computer model and search in the (provided here) ini file which link to follow.
      At first, Dell was kind enough to provide only one link but now, they provide two of them. The first one is now a .txt file (  ) whereas my script has been designed to download only the fist and latest link released for the BIOS Update.

      Here's the current code which is working with only the first and latest link of the BIOS category:
      So the question is: 
      In the case of double links like shown in the picture above, how it is possible to tell the script to download only the link containing an the .exe file?
      Of course, I could have changed the array result to [1] instead of [0] [which is working] but it seems that Dell does that randomly and that I deal with a lot of computer models.
      Thanks for the help you can provide, 
      -31290-
       
      SEE_BIOS_LINKS.ini
    • Mark917
      By Mark917
      I am trying to extract a date and time from a website using InetRead.  The source for the page I am reading shows the date and time as shown below.  I need to somehow extract the correct date and time from this information.  Is there a function or calculation that will do this?  The source shown here correlates to 15:20 (time) 29.03.17 (date).
      <div class="cell game-date" data-time="1490818800000"> <div class="site__time" data-time="1490818800000"> <div class="time"></div> <div class="date"></div> </div> </div>  
×