Jump to content

Recommended Posts

Posted (edited)

Ok simple question becose I am stuck trying to read the text from a chrome windows. 

 

How to record the [Active] chrome windows source code into a text file. To make search into this file after. 

 

I tryed a lot of thing actualy this is what i got.... not working

#include <MsgBoxConstants.au3>
#include <Inet.au3>

Example()

Func Example()
       Local Const $sFilePath = "C:\Users\Jordane.guemara\Desktop\AutoIT\test2.txt"
       ConsoleWrite(_INetGetSource('[active]'))
       $dData =(_INetGetSource('[active]'))
       FileWrite($sFilePath, $dData)
EndFunc   ;==>Example

 

Is there a way to do that fast and easy ? 

Edited by caramen

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

 

Posted

Help file says :   _INetGetSource ("The URL of the site")
and '[active]' is NOT a url

Suggestion (if you have not got the url yet) :
ControlSend F6  to highlight the url in the address bar, then Ctrl+C to copy, then ClipGet to get the url so you can use it in _INetGetSource

Posted

I cant do that. Becose the website need a login. So i need to get the source code from my active window. Nothing else :(

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

 

Posted (edited)

I confirme i did that, it work perfectly. But does not returning the source from the website where I am logged at.

 

#include <MsgBoxConstants.au3>
#include <Inet.au3>

HotKeySet("{F2}", "Example")

While (1)
   Sleep (100)
WEnd

;~ Example()

Func Example()
       Send ("{F6}")
       Send ("^c")
       $oUrl = ClipGet ()
       Local Const $sFilePath = "C:\Users\Jordane.guemara\Desktop\AutoIT\test3.txt"
       ConsoleWrite(_INetGetSource($oUrl))
       $dData =(_INetGetSource($oUrl))
       FileWrite($sFilePath, $dData)
EndFunc   ;==>Example

 

 

I also got that... work too but bring me to the login screen... so i cant get my desired source code :'( 

#include <MsgBoxConstants.au3>
#include <Inet.au3>

HotKeySet("{F2}", "Example")

While (1)
   Sleep (100)
WEnd

;~ Example()

Func Example()
       Send ("{F6}")
       Send ("^c")
       $oUrl = ClipGet ()
       Local Const $sFilePath = "C:\Users\Jordane.guemara\Desktop\AutoIT\text.txt"
       ConsoleWrite(_INetGetText($oUrl))
       $dData =(_INetGetText($oUrl))
       FileWrite($sFilePath, $dData)
EndFunc   ;==>Example


Func _INetGetText($sURL)
    Local $bStr = InetRead($sURL, 19)
    If @error Then
        Return SetError(1, 0, 0)
    EndIf
        Local $oHTML = ObjCreate("HTMLFILE")
    If @error Then Return SetError(2, 0, 0)
        $oHTML.Open()
    $oHTML.Write(BinaryToString($bStr))
        ; $oHTML....
        Return SetError(0, 0, $oHTML.Body.InnerText)
EndFunc ;==>_INetGetText

 

Is there an other way to di it ?

Edited by caramen

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

 

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