Jump to content

Recommended Posts

On 05/01/2017 at 11:49 PM, LinkOut said:

it's 100% safe and secure,

Curl may be, but Telegram itself is not. Using it for secure communications without two-factor authentication leaves a security hole you can drive a truck through, see for example here, here, here, and here.

Link to post
Share on other sites
  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi! I wrote an UDF that can simplify the way you can control Telegram Bot with AutoIt. If you don't know what is a Telegram Bot, maybe you should read their official website here. All about this UDF i

Added to UDF List on AutoIt WikiPage, here: https://www.autoitscript.com/wiki/User_Defined_Functions#Social_Media_and_other_Website_API  

Perhaps we should give people who post UDFs a short time to get feedback from the community and improve the scripts, before we rush to add them to the Wiki.

Posted Images

On 12/1/2017 at 8:18 AM, bambus1980 said:

its cool, but, what about using proxy server, ntlm proxy? if I use curl it will be: curl -s -k -U : --proxy-ntlm --proxy server:port https://google.com -o index.htm

how make that UDF working with proxy?

If you want to use proxy with cURL, download the older version of the UDF and add your commands to the $query that start curl with arguments.
 

On 12/1/2017 at 10:14 AM, RTFC said:

Curl may be, but Telegram itself is not. Using it for secure communications without two-factor authentication leaves a security hole you can drive a truck through, see for example here, here, here, and here.

I think that if you use THIS udf for secure communications... it's not the right thing.

On 12/1/2017 at 11:32 AM, TheDcoder said:

I created an issue at your repository :)

 

 
I saw! Thanks^_^
Link to post
Share on other sites
  • 1 month later...

Many thanks for your script, I am seeking for this for a long time other than python one.

I had a few issues and not sure is it should related to this UDF and ask here.

1. Proxy issue also, it can't detect my computer setting for the proxy set inside IE.

2. How to convert the non english text received as unicode code point to readable string e.g. \u5514\u7dca\u8981 ?

3. How to send emoji using sendmessage?

Link to post
Share on other sites
On 16/2/2017 at 9:30 AM, mintea said:

Many thanks for your script, I am seeking for this for a long time other than python one.

I had a few issues and not sure is it should related to this UDF and ask here.

1. Proxy issue also, it can't detect my computer setting for the proxy set inside IE.

2. How to convert the non english text received as unicode code point to readable string e.g. \u5514\u7dca\u8981 ?

3. How to send emoji using sendmessage?

1. I don't really know how to use a proxy with the WinHttp udf that the script use. You can search for a different library that allow direct connection between a proxy, and use this to send http request to Telegram server;

2. \u5514\u7dca\u8981 <- this is the Unicode of an Emoji. You canconvert this to another encoding format but...

3. You can find ready-made UDFs that manage Emoji and can convert encoding to another and send them to Telegram. Or, better, SciTE (or Notepad++) support UTF-8 encoding and you can just copy emojis from telegram or emojipedia and paste directly into source code, and done!

 
Link to post
Share on other sites
  • 2 weeks later...
On 4/3/2017 at 0:55 AM, sakamoto said:

Thanks a lot for UDF. Someone else can give an example of inline_keyboard?

Thank you for using it! To use inline_keyboard first you have to create an array of array of button (sound bad, I know) and then add this (encoded in json format) to the query. I'm working on it but only in php for the moment. If this can help you:

$keyboard = array("inline_keyboard" => array(array(array("text" => "ButtonText", "callback_data" => "CallbackText"),array("text" => "ButtonText2", "callback_data" => "CallbackText2"))));
$keyboard = json_encode($keyboard, true);

And after send it as:

http://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=12345678&text=test&reply_markup=$keyboard

 

Link to post
Share on other sites

LinkOut, thanks for the answer.

I figured out the buttons, but get an error when receiving callback_data.

Other methods "url" "switch_inline_query" work out well.

#include "Telegram UDF.au3"
$ikeyb = '{"inline_keyboard":[[{"text":"Button 1","callback_data":"data 1"}]]}'
_InitBot("xxxIDxxx","xxxTOKENxxx")

While 1
    $msgData = _Polling()
    If $msgData <> '' Then ConsoleWrite($msgData[0]&'|'&$msgData[1]&'|'&$msgData[2]&'|'&$msgData[3]&@LF)
    Switch $msgData[3]
        Case '777'
            _SendMsg($msgData[2], 'Message', Default, $ikeyb)
    EndSwitch
WEnd
Telegram UDF.au3" (481)

$dataArray[2] = $tmpChatID[3]
$dataArray[2] = ^ ERROR

 

Edited by sakamoto
Link to post
Share on other sites

My post above are no longer relevant.
I modified _JSONDecode function to return more variables:

     $msgData[4] = Callback query ID
     $msgData[5] = Callback data
     $msgData[6] = MessageID

And add new functions to respond to callback query:


     _answerCallbackQuery($ChatID, $Text, $Alert = True, $Cache_time = '5')
     _editMessageReplyMarkup($ChatID, $message_id, $reply_markup)
     _editMessageText($ChatID, $message_id, $Text, $reply_markup)

This for my bot is still enough.

Func _JSONDecode($JSONMsg)
   Local $firstSplit = StringSplit($JSONMsg,"update_id",1)
   Local $secondSplit = StringSplit($firstSplit[2], ",")
   Local $dataArray[7]
   For $i=1 to $secondSplit[0]
      Local $data = $secondSplit[$i]
      If StringLeft($data,2) = '":' Then $dataArray[0] = StringTrimLeft($data,2)
      If StringInStr($data,'username') Then
         $tmpUsername = StringSplit($data,':')
         $tmpUsername[2] = StringTrimLeft($tmpUsername[2],1)
         $tmpUsername[2] = StringTrimRight($tmpUsername[2],1)
         $dataArray[1] = $tmpUsername[2]
      EndIf
      If StringInStr($data,'"chat"') Then
         $tmpChatID = StringSplit($data,':')
         $dataArray[2] = $tmpChatID[3]
      EndIf
      If StringInStr($data,'text') Then
         $tmpText = StringSplit($data,':')
         If StringInStr($tmpText[2],'"}}]}') Then
            $tmpText[2] = StringTrimLeft($tmpText[2],1)
            $tmpText[2] = StringTrimRight($tmpText[2],5)
            $dataArray[3] = $tmpText[2]
         ElseIf StringInStr($tmpText[2],'"}}') Then
            $tmpText[2] = StringTrimLeft($tmpText[2],1)
            $tmpText[2] = StringTrimRight($tmpText[2],3)
            $dataArray[3] = $tmpText[2]
         ElseIf StringInStr($tmpText[2],'"}') Then
            $tmpText[2] = StringTrimLeft($tmpText[2],1)
            $tmpText[2] = StringTrimRight($tmpText[2],2)
            $dataArray[3] = $tmpText[2]
         ElseIf StringRight($tmpText[2],1) = '"' Then
            $tmpText[2] = StringTrimLeft($tmpText[2],1)
            $tmpText[2] = StringTrimRight($tmpText[2],1)
            $dataArray[3] = $tmpText[2]
         EndIf
      EndIf
      If StringInStr($data,'callback_query') Then
         $tmpCallBQ = StringSplit($data,':')
         $tmpCallBQ[3] = StringTrimLeft($tmpCallBQ[3],1)
         $tmpCallBQ[3] = StringTrimRight($tmpCallBQ[3],1)
         $dataArray[4] = $tmpCallBQ[3]
     EndIf
      If StringInStr($data,'data') Then
         $tmpCallBData = StringSplit($data,':')
         If StringInStr($tmpCallBData[2],'"}}]}') Then
            $tmpCallBData[2] = StringTrimLeft($tmpCallBData[2],1)
            $tmpCallBData[2] = StringTrimRight($tmpCallBData[2],5)
            $tmpCallBData[2] = $tmpCallBData[2]
            $dataArray[5] = $tmpCallBData[2]
         ElseIf StringInStr($tmpCallBData[2],'"}}') Then
            $tmpCallBData[2] = StringTrimLeft($tmpCallBData[2],1)
            $tmpCallBData[2] = StringTrimRight($tmpCallBData[2],3)
            $dataArray[5] = $tmpCallBData[2]
         ElseIf StringInStr($tmpCallBData[2],'"}') Then
            $tmpCallBData[2] = StringTrimLeft($tmpCallBData[2],1)
            $tmpCallBData[2] = StringTrimRight($tmpCallBData[2],2)
            $dataArray[5] = $tmpCallBData[2]
         ElseIf StringRight($tmpCallBData[2],1) = '"' Then
            $tmpCallBData[2] = StringTrimLeft($tmpCallBData[2],1)
            $tmpCallBData[2] = StringTrimRight($tmpCallBData[2],1)
            $dataArray[5] = $tmpCallBData[2]
        EndIf
     EndIf
    If StringInStr($data,'message_id') Then
         $tmpMsgID = StringSplit($data,':')
         $dataArray[6] = $tmpMsgID[3]
     EndIf
   Next
   If $dataArray[1] = '' Then
      For $i=1 to $secondSplit[0]
         If StringInStr($secondSplit[$i],'first_name') Then
            $tmpUsername = StringSplit($secondSplit[$i],':')
            $tmpUsername[2] = StringTrimLeft($tmpUsername[2],1)
            $tmpUsername[2] = StringTrimRight($tmpUsername[2],1)
            $dataArray[1] = $tmpUsername[2]
         EndIf
      Next
   EndIf
   Return $dataArray
EndFunc ;==> _JSONDecode



Func _answerCallbackQuery($ChatID, $Text, $Alert = True, $Cache_time = '5')
   Local $Query = $URL & "/answerCallbackQuery?callback_query_id=" & $ChatID &"&text=" & $Text & "&show_alert=" & $Alert & "&cache_time=" & $Cache_time
   Local $Response = HttpPost($Query)
   ;Return $Response
   Return True
EndFunc ;==> _answerCallbackQuery

Func _editMessageReplyMarkup($ChatID, $Message_id, $Reply_markup)
   Local $Query = $URL & "/editMessageReplyMarkup?chat_id=" & $ChatID  &"&message_id=" & $Message_id & "&reply_markup=" & $Reply_markup
   Local $Response = HttpPost($Query)
   ;Return $Response
   Return True
EndFunc ;==> _editMessageReplyMarkup

Func _editMessageText($ChatID, $Message_id, $Text, $Reply_markup)
   Local $Query = $URL & "/editMessageText?chat_id=" & $ChatID  &"&message_id=" & $Message_id & "&text=" & $Text & "&reply_markup=" & $Reply_markup
   Local $Response = HttpPost($Query)
   ;Return $Response
   Return True
EndFunc ;==> _editMessageText

 

Edited by sakamoto
Link to post
Share on other sites
21 hours ago, sakamoto said:

<snip>

<snip>

 

Wow, awesome work. Thank you for share. I'm trying to find an easy way to split the message like json_decode function in PHP to make easier this process.

Edited by Melba23
Removed huge unecessary quote
Link to post
Share on other sites
  • Moderators

LinkOut,

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 - responders know what they wrote and it just pads the thread unnecessarily.

volond,

Welcome to the AutoIt forums. But as this is an English speaking forum, it would have helped more if you had translated the link.

M23

 

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

 

Link to post
Share on other sites
  • 1 month later...
  • Developers

CHATID is the id of the person the BOT receives/sends the messages to, so simply send an messages from your personal telegram account to the BOTID you have created and then  read that message with the BOT's account information. You will find the CHATID in the returned JSON information.

Jos 

Edited by 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.
  :)

Link to post
Share on other sites
  • 4 months later...
  • 4 weeks later...
  • Developers

Try this version:

$msreply= "Wellcome To 'Zoo World'.%0AYou can control by sending these commands: ......"
_SendMsg($msgData[2],$msreply )

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

Link to post
Share on other sites
I'm somewhere lost in this.
I made a bot and have a token, botname and a username.
How can I send a message to a telegram account from a AutoIt script?
 
#include "Telegram UDF.au3"

$ChatID = "Your_Chat_ID_For_Test"
_InitBot("Bot_ID","Bot_Token")

ConsoleWrite("Test _GetUpdates   -> "  & @TAB & _GetUpdates() & @CRLF)
ConsoleWrite("Test _GetMe        -> "  & @TAB & _GetMe() & @CRLF)

ConsoleWrite("Test _SendMsg      -> "  & @TAB & _SendMsg($ChatID,"Test _SendMsg") & @CRLF)
ConsoleWrite("Test _ForwardMsg   -> "  & @TAB & _ForwardMsg($ChatID,$ChatID,'MsgID') & @CRLF)

ConsoleWrite("Test _SendPhoto    -> "  & @TAB & _SendPhoto($ChatID,"C:\image.jpg","Test _SendPhoto") & @CRLF)
ConsoleWrite("Test _SendVideo    -> "  & @TAB & _SendVideo($ChatID,"C:\video.mp4","Test _SendVideo") & @CRLF)
ConsoleWrite("Test _SendAudio    -> "  & @TAB & _SendAudio($ChatID,"C:\audio.mp3","Test _SendAudio") & @CRLF)
ConsoleWrite("Test _SendDocument -> "  & @TAB & _SendDocument($ChatID,"C:\document.txt","Test _SendDocument") & @CRLF)
ConsoleWrite("Test _SendVoice    -> "  & @TAB & _SendVoice($ChatID,"C:\voice.ogg","Test _SendVoice") & @CRLF)
ConsoleWrite("Test _SendSticker  -> "  & @TAB & _SendSticker($ChatID,"C:\sticker.webp") & @CRLF)
ConsoleWrite("Test _SendLocation -> "  & @TAB & _SendLocation($ChatID,"74.808889","-42.275391") & @CRLF)
ConsoleWrite("Test _SendContact  -> "  & @TAB & _SendContact($ChatID,"0123456789","Josh") & @CRLF)
ConsoleWrite("Test _SendChatAction -> " & @TAB & _SendChatAction($ChatID,"typing") & @CRLF)

ConsoleWrite("Test _GetUserProfilePhotos -> " & @TAB & _GetUserProfilePhotos($ChatID) & @CRLF)
ConsoleWrite("Test _GetChat              -> " & @TAB & _GetChat($ChatID) & @CRLF)

While 1
   $msgData = _Polling()
   _SendMsg($msgData[2],$msgData[3])
WEnd

 

I use this test script and bot token is clear but what do I insert at Bot_id, is this the botname or the username?
And how do I receive the chat_id so that I can send some text to a other telegram account?
 
What ever I try to insert at the bot_id I just can get it to work.
Link to post
Share on other sites
  • 2 weeks later...

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.

  • Similar Content

    • By p4sCh
      Hello everyone,
      I've created a UDF for basic communication with SSH servers. I know there is already such a UDF, but I wasn't satisfied with it for my purpose, so I created a new one.
      This UDF also acts as a wrapper for the plink executable. Its essential functions are _SSHConnect, _SSHSend, _SSHRecv and _SSHCloseSocket.
      It does support multiple simultaneous connections and aims to be pretty robust. Feel free to share your opinions
      Two of the included examples use a slightly modified version of Vintage Terminal by @Chimp
      Download
      The download includes ssh.au3 (UDF), plink.exe (necessary), vintage terminal and code examples:
      Version 1.0.1
      - fixed rare _SSHConnect bug where "ssh-host-key prompt" was not answered
      SSH UDF 1.0.1.zip
       
    • By water
      I have started to rewrite the PowerPoint UDF similar to the Word, Excel and Outlook UDF. The new UDF will not be compatible with the existing one.
      I will add examples, documentation, a section in the wiki etc.
      So far the following functions have been coded - more are on the ToDo list.
      _PPT_Open: Open a connection to a running instance of PowerPoint or start a new one _PPT_Close: Close a PowerPoint instance _PPT_CommentAdd: Add a Comment anywhere on a Slide or connected to a Shape (version 1.5.0.0 2021-08-31) _PPT_CommentDelete: Delete a single Comment from a Slide or all Comments from a SlideRange (version 1.5.0.0 2021-08-31) _PPT_CommentList: Get a list of all Comments in a Presentation (version 1.5.0.0 2021-08-31) _PPT_ConvertUnits: Convert units (like centimeters) to other units (like points) (version 1.3.0.0 2021-08-17) _PPT_HeaderFooterList: Returns a list of Headers and Footers for a Presentation (version 1.1.0.0 2021-07-25, removed with version 1.4.0.0 2021-08-25) _PPT_HeaderFooterSet: Sets the Header/Footer for a Slide/Slides or the Slide-/Notes-/Handout-/Title-Master of the Presentation (version 1.2.0.0 2021-08-09) _PPT_PresentationAttach: Attach to an already opened Presentation _PPT_PresentationClose: Close a Presentation _PPT_PresentationExport: Export one/multiple/all Slides as PDF or XPS. _PPT_PresentationExportGraphic: Export one/multiple/all Slides in a graphic format. _PPT_PresentationList: Returns a list of currently open Presentations (version 1.0.0.0 2021-07-20) _PPT_PresentationNew: Create a new Presentation _PPT_PresentationOpen: Open an existing Presentation _PPT_Print: Print one/multiple/all Slides of a Presentation (version 1.0.0.0 2021-07-20) _PPT_PresentationSave: Save a Presentation _PPT_PresentationSaveAs: Save a Presentation to another location or with another type _PPT_ShapeAdd: Add a Shape to a single or multiple Slides (version 1.1.0.0 2021-07-25) _PPT_ShapeAlignDistribute: Aligns and distributes the Shapes in the specified ShapeRange (version 1.6.0.0 - to be released) _PPT_ShapeCopyMove: Copy/move a Shape(s) of a single Slide to a Slide(s) in the same or a different Presentation (version 1.1.0.0 2021-07-25) _PPT_ShapeDelete: Delete a Shape or Shapes from a single or multiple Slides (version 1.1.0.0 2021-07-25) _PPT_SlideAdd: Add slide(s) to a Presentation _PPT_SlideCopyMove: Copy, move, duplicate Slide(s) _PPT_SlideDelete: Delete Slide(s) _PPT_SlideShow: Show a Presentation _PPT_TableGet: Extract data from a PowerPoint Table Shape to an array (version 1.3.0.0 2021-08-17) _PPT_TableSet: Write data to a PowerPoint Table Shape (version 1.3.0.0 2021-08-17) _PPT_TextFindReplace: Find & replace text throughout entire PowerPoint presentation (version 1.0.0.0 2021-07-20) _PPT_TextSet: Sets/modifies the Text of a Shape or Shapes of a single or multiple Slides (version 1.2.0.0 2021-08-09 Which functions do you want me to add to the UDF?
      ToDo list:
      create slide (JLogan3o13) - Done: _PPT_SlideAdd Apply template to slide (JLogan3o13) - Done: _PPT_SlideAdd Apply theme to slide (JLogan3o13) Cut/Copy/Duplicate/Move/Delete slide(s) (JLogan3o13) - Done: _PPT_SlideCopyMove, _PPT_SlideDelete Export slides (JLogan3o13) - Done: _PPT_PresentationExport Cut/Copy/Duplicate/Move/Delete shape(s) (JLogan3o13): Done : _PPT_ShapeCopyMove, _PPT_ShapeDelete (version 1.1.0.0 2021-07-25) ApplyAnimation, Select, SetDefaultProperties, and zOrder for shape(s) (JLogan3o13) Searching and replacing text (pcjunki) - Done: _PPT_TextFindReplace (version 1.0.0.0 2021-07-20) Export slides in a graphic format (JPG, GIF, PNG ...) (UEZ) - Done: _PPT_PresentationExportGraphic The UDF can be downloaded from the download forum.
       
    • By seadoggie01
      This UDF is because I'm tired of trying to use UI Automation and Send to automate Adobe Acrobat. I often need to read the contents of PDFs and Acrobat is not easy to work with as a window.  The functions are based on the API Reference from Adobe located here.
      Acrobat Pro is required for all functions.
      It's very beta right now, but it still seems to work. Currently, the functions are based around page level manipulation of PDF documents: re-arranging, swapping, deleting, and moving pages as this is what I use the most.
      Please feel free to request/suggest features!
       
       
    • By DonChunior
      Introduction 
      In the course of my research for a project involving, among other things, the transfer of large amounts of data, I came across the BITS service and from that the idea for this UDF was born.
      For a brief overview, I'll quote from Microsoft's BITS website (https://docs.microsoft.com/en-us/windows/win32/bits/background-intelligent-transfer-service-portal).
      Availability 🛒
      The BITS UDF can be downloaded from my GitHub repository:
      🔗 https://github.com/DonChunior/BITS-UDF
      Comments 💬
      Currently, only an alpha version of the UDF is available.
      This contains by and large the full functionality of the object interfaces, but still completely lacks error checking and handling.
      I will implement this in the upcoming beta version.
      Therefore I ask you to use the UDF only for testing purposes but not in productive code!
      Acknowledgment 🤝
      Many thanks to @Nine and @Danyfirex.
      You helped me very well in solving some tricky problems.
    • By Hermes
      I have Index.html where it contains a frame with a source "frame1.html". I can select/highlight elements in index.html but unable to select/highlight elements inside the frame with the src "frame1.html", the autoit output is throwing error:
      __WD_Post: URL=HTTP://127.0.0.1:9515/session/2143396006437be4005db3b84acc1496/element/8be1c3c4-5bb1-42b1-8cde-7954765cbc61/element; $sData={"using":"css selector","value":"frameset:nth-of-type(1)"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"css selector\",\"selector\":\"frameset:nth-of-type(1)\"}\n (Session info: chrome=90.0.4430.212)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00FCE7D3+124883]\n\tOrdinal0 [0x00FCE7B1+124849]\n\tGetHandleVerifier [0x01218688+193832]\n\tGetHandleVerifier [0x0123C478+340760]\n\tGetHandleVerifier [0x012361F1+315537]\n\tGetHandleVerifier [0x012516BA+427354]\n\tGetHandleVerifier [0x01236176+315414]\n\tGetHandleVerifier [0x0125174A+427498]\n\tGetHandleVerifier [0x0125D6EB+476555]\n\tGetHandleVerifier [0x0125154B+426987]\n\tGetHandleVerifier [0x01234FFD+310941]\n\tGetHandleVerifier [0x01235D8E+314414]\n\tGetHandleVerifier [0x01235D19+314297]\n\tGetHandleVerifier [0x012F31EC+1089676]\n\tGetHandleVerifier [0x012F17C9+1082985]\n\tGetHandleVerifier [0x012F13A3+1081923]\n\tGetHandleVerifier [0x013ED9FD+2115741]\n\tOrdinal0 [0x0111B82E+1488942]\n\tOrdinal0 [0x010B5A7D+1071741]\n\tOrdinal0 [0x010B559B+1070491]\n\tOrdinal0 [0x010B54B1+1070257]\n\tOrdinal0 [0x010EFF53+1310547]\n\tBaseThreadInitThunk [0x770662C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x776B1B69+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x776B1B34+1028]\n"}} Auto IT Script:
      #Include "wd_core.au3" #Include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, 'index.html') _WD_LoadWait($sSession) Local $index = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)") Local $index1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)", $index) Local $index2 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frame:nth-of-type(1)", $index1) Local $index3 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)", $index2) _WD_HighlightElement($sSession, $index2, 1) _WD_HighlightElement($sSession, $index3, 1) _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}' EndFunc ;==>SetupChrome  

      frame1.html index.html
×
×
  • Create New...