Jump to content

Read out certain html code in the FireFox browser


Kepo
 Share

Recommended Posts

Hello dear audio professionals. I am new to this sector. I have already written some small autoit programs, but unfortunately I am now reaching my limits. :-(
I would now like to read out an HTML code and only a certain part of it and I absolutely do not know how to do this.
I already have some ... include but unfortunately I can't find out anything about it.
I already have it with wd_core.au3
wd_helper.au3
wd_demo.au3
_HTML.au3
just tried I haven't found a solution yet.
My question is, how and with what can I manage that I can read out the specific text.

I hope you can help me.
thank you

 
Link to comment
Share on other sites

I say thank you for your quick response Danp2 and I've read a lot about you here. I've already downloaded the wd_ core.au3, but I always get an error message in the start_up area. there is always the error at Local $ sWinHttpVer = __WinHttpVer () and I don't know how to fix it 😞 
maybe you know the solution. I also try to insert the html text here which I would like to read out.

 
Link to comment
Share on other sites

Yes, I read it and I have now found the correct winhttp.au3 and now wd_core.au3 is working again.

In the demo I get this message back:
_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WDStartup: OS: WIN_10 WIN32_NT 19041
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.3.0.6 (Up to date)
_WDStartup: WinHTTP: 1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>)
_WDStartup: Driver: geckodriver.exe
_WDStartup: Params: --log trace
_WDStartup: Port: 4444
_WD_Startup ==> General Error: Error launching web driver!
 
I am of the opinion that I still have to adjust the geckodriver because it is looking at a wrong ip address and a wrong port. Is that correct or not? How can I change the geckodriver so that it runs on the correct ip address? Unfortunately, I have not yet found anything suitable to convert it. thank you for your help
Edited by Melba23
Removed unintended content
Link to comment
Share on other sites

@Kepo You need to grab the updated WinHTTP source from the link provided. That's the correct port for geckodriver. It appears that your script can't find the geckodriver executable. If it isn't in your working directory, then you need to modify this line so that it gives the full path to the executable --

_WD_Option('Driver', 'geckodriver.exe')

P.S. Not sure what all that "junk" is at the end of your post. 🙄

Link to comment
Share on other sites

Now it works I have now put everything together in a new location, i.e. my Autoit file and the geckodriver. now I am curious how the html code will continue. Thank you, I am really happy that there is always someone who can help you in such matters.

Link to comment
Share on other sites

@Danp2:

Hello, it's me again :-)
I've tried a little now and would have tried to get to this page, but unfortunately I'm hanging again now.
This is the code I entered into Autoit

#include <wd_core.au3>
#include <wd_helper.au3>
#include <JSON.au3>
#include <WinHttp.au3>
#include "WinHttpConstants.au3"

Local $sDesiredCapabilities, $sSession
Firefox ()

_WD_Startup()
_WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://pocketoption.com/de/cabinet")

func Firefox()
_WD_Option("Driver", "C:\Users\Jürgen\Desktop\Autoit\FireFox\geckodriver.exe")
_WD_Option('DriverParams', '--binary "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" --log trace ')
_WD_Option('Port', 4444)
EndFunc

$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'

_WD_Shutdown()

 

and this is the feedback in the console

_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WDStartup: OS:    WIN_10 WIN32_NT 19041
_WDStartup: AutoIt:    3.3.14.5
_WDStartup: WD.au3:    0.3.0.6 (Up to date)
_WDStartup: WinHTTP:    1.6.4.2
_WDStartup: Driver:    C:\Users\Jürgen\Desktop\Autoit\FireFox\geckodriver.exe
_WDStartup: Params:    --binary "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" --log trace
_WDStartup: Port:    4444
_WDStartup: Existing instance of geckodriver.exe detected!
__WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData=
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: ","stacktrace":"Sy...
__WD_Post ==> Invalid argument: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: ","stacktrace":"Syntax error at :1:0"}}
_WD_CreateSession: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: ","stacktrace":"Syntax error at :1:0"}}
_WD_CreateSession ==> Webdriver Exception: HTTP status = 400
__WD_Post: URL=HTTP://127.0.0.1:4444/session//url; $sData={"url":"https://pocketoption.com/de/cabinet"}
__WD_Post: StatusCode=405; ResponseText=HTTP method not allowed...
_WD_Navigate: HTTP method not allowed
+>00:35:36 AutoIt3.exe ended.rc:0

what should tell me now this message ???

that I cannot access this page and that I have to think of another way to get my data or how ???
Thanks for your help

 

 

 

Edited by Kepo
Link to comment
Share on other sites

Your call to _WD_CreateSession is failing due to an invalid Capabilities string. See SetupGecko function in wd_demo.au3 for the correct format. Actually, after taking a closer look, it appears that you are passing an empty string as the parameter to _WD_CreateSession. This would be because you've declared the variable but haven't assigned a value to it yet.

P.S. See this post for the proper way to post code in the forum

Edited by Danp2
Link to comment
Share on other sites

_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WDStartup: OS: WIN_10 WIN32_NT 19041 
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.3.0.7 (Up to date)
_WDStartup: WinHTTP:    1.6.4.2
_WDStartup: Driver: geckodriver.exe
_WDStartup: Params: --log trace
_WDStartup: Port:   4444
__WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}
__WD_Post: StatusCode=200; ResponseText={"value":{"sessionId":"ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee","capabilities":{"acceptInsecureCerts":t...
_WD_CreateSession: {"value":{"sessionId":"ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"79.0","moz:accessibilityChecks":false,"moz:buildID":"20200720193547","moz:geckodriverVersion":"0.27.0","moz:headless":false,"moz:processID":5876,"moz:profile":"C:\\Users\\Jürgen\\AppData\\Local\\Temp\\rust_mozprofileGZwp3e","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"pageLoadStrategy":"normal","platformName":"windows","platformVersion":"10.0","rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"}}}
Bypass: DemoTimeouts
+Running: DemoNavigation
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url; $sData={"url":"http://google.com"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Navigate: {"value":null}
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window/handles
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":["8"]}...
_WD_Window: {"value":["8"]}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"8"}...
_WD_Window: {"value":"8"}...
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/execute/sync; $sData={"script":"window.open(arguments[0], '', arguments[1])", "args":["",""]}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ExecuteScript: {"value":null}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window/handles
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":["8","4294967297"]}...
_WD_Window: {"value":["8","4294967297"]}...
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window; $sData={"handle":"4294967297"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Window: {"value":null}...
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url; $sData={"url":"http://yahoo.com"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Navigate: {"value":null}
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window/handles
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":["8","4294967297"]}...
_WD_Window: {"value":["8","4294967297"]}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"4294967297"}...
_WD_Window: {"value":"4294967297"}...
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/execute/sync; $sData={"script":"window.open(arguments[0], '', arguments[1])", "args":["http://bing.com","width=200,height=200"]}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ExecuteScript: {"value":null}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window/handles
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":["8","4294967297","4294967298"]}...
_WD_Window: {"value":["8","4294967297","4294967298"]}...
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window; $sData={"handle":"4294967298"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Window: {"value":null}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"about:blank"}...
_WD_Action: {"value":"about:blank"}
URL=about:blank
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window/handles
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":["8","4294967297","4294967298"]}...
_WD_Window: {"value":["8","4294967297","4294967298"]}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"4294967298"}...
_WD_Window: {"value":"4294967298"}...
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window; $sData={"handle":"8"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Window: {"value":null}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"https://www.google.com/?gws_rd=ssl"}...
_WD_Action: {"value":"https://www.google.com/?gws_rd=ssl"}
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"https://www.google.com/?gws_rd=ssl"}...
_WD_Action: {"value":"https://www.google.com/?gws_rd=ssl"}
URL=https://www.google.com/?gws_rd=ssl
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window/handles
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":["8","4294967297","4294967298"]}...
_WD_Window: {"value":["8","4294967297","4294967298"]}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"8"}...
_WD_Window: {"value":"8"}...
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window; $sData={"handle":"8"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Window: {"value":null}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"https://www.google.com/?gws_rd=ssl"}...
_WD_Action: {"value":"https://www.google.com/?gws_rd=ssl"}
__WD_Post: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/window; $sData={"handle":"4294967297"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Window: {"value":null}...
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"https://consent.yahoo.com/v2/collectConsent?sessionId=3_cc-session_f2d0530a-bef1-480d-8c02...
_WD_Action: {"value":"https://consent.yahoo.com/v2/collectConsent?sessionId=3_cc-session_f2d0530a-bef1-480d-8c02-7aeb66599ddf"}
__WD_Get: URL=HTTP://127.0.0.1:4444/session/ad005b1d-fba3-45fd-8fa0-acf5c76cf3ee/url
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"https://consent.yahoo.com/v2/collectConsent?sessionId=3_cc-session_f2d0530a-bef1-480d-8c02...
_WD_Action: {"value":"https://consent.yahoo.com/v2/collectConsent?sessionId=3_cc-session_f2d0530a-bef1-480d-8c02-7aeb66599ddf"}
URL=https://consent.yahoo.com/v2/collectConsent?sessionId=3_cc-session_f2d0530a-bef1-480d-8c02-7aeb66599ddf
+Finished: DemoNavigation
Bypass: DemoElements
Bypass: DemoScript
Bypass: DemoCookies
Bypass: DemoAlerts
Bypass: DemoFrames
Bypass: DemoActions
Bypass: DemoDownload
Bypass: DemoWindows
Bypass: DemoUpload

Hello Damp2
So now I've run the WD_Demo again and got this result. In my opinion it should work that I can access a website or read something

Link to comment
Share on other sites

now i finally managed to access the site. Unfortunately, the geckodriver closes now and I can no longer see whether I am receiving a get or a post, unless I no longer need it.
with this code.
 
#include <wd_core.au3>
#include <wd_helper.au3>
#include <JSON.au3>
#include <WinHttp.au3>
#Include "BinaryCall.au3"
;~ #include <wd_demo.au3>


Local $sDesiredCapabilities, $sSession
Firefox ()

$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'
$sData ='{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}'


_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://pocketoption.com/de/login/")
func Firefox()
_WD_Option("Driver", "C:\Users\Jürgen\Desktop\Autoit\FireFox\geckodriver.exe")
_WD_Option('DriverParams', '--binary "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" --log trace ')
_WD_Option('Port', 4444)
EndFunc

_WD_Shutdown()


;~ Texte

;~ Label
;~ <div class="assets-favorites__lable">USD/CHF</div>
;~ <div class="assets-favorites__lable">EUR/USD</div>
;~ <div class="assets-favorites__lable">USD/JPY</div>
;~ <div class="assets-favorites__lable">USD/CAD</div>
;~ <div class="assets-favorites__lable">AUD/USD</div>
;~ <div class="assets-favorites__lable">EUR/AUD</div>
;~ <div class="assets-favorites__lable">EUR/GBP</div>


;~ Zeit

;~ <div class="value__val">00:00</div

;~ Handelsbetrag
;~ <input type="text" autocomplete="off" value="$1">

;~ Geschlossene Paare

;~ <a>USD/CAD</a>

;~ Gewonnen
;~ <div class="price-up">$1.73</div>

;~ Buttons
;~ <a class="btn btn-call">
;~ <a class="btn btn-put">

I still want to read out texts and labels or bring them to the point where autoit recognizes the text by means of labels.

I hope that it is somehow possible to read these things out

 

I get this code back in the console

_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WDStartup: OS: WIN_10 WIN32_NT 19041 
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.3.0.7 (Up to date)
_WDStartup: WinHTTP:    1.6.4.2
_WDStartup: Driver: C:\Users\Jürgen\Desktop\Autoit\FireFox\geckodriver.exe
_WDStartup: Params: --binary "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" --log trace 
_WDStartup: Port:   4444
__WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}
__WD_Post: StatusCode=200; ResponseText={"value":{"sessionId":"2034720a-6d55-4087-980e-7f7e006f93ca","capabilities":{"acceptInsecureCerts":t...
_WD_CreateSession: {"value":{"sessionId":"2034720a-6d55-4087-980e-7f7e006f93ca","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"79.0","javascriptEnabled":true,"moz:accessibilityChecks":false,"moz:buildID":"20200720193547","moz:geckodriverVersion":"0.27.0","moz:headless":false,"moz:processID":9776,"moz:profile":"C:\\Users\\Jürgen\\AppData\\Local\\Temp\\rust_mozprofilegOf5b2","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"nativeEvents":true,"pageLoadStrategy":"normal","platformName":"windows","platformVersion":"10.0","rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"}}}
__WD_Post: URL=HTTP://127.0.0.1:4444/session/2034720a-6d55-4087-980e-7f7e006f93ca/url; $sData={"url":"https://pocketoption.com/de/login/"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Navigate: {"value":null}

thank you for your perfect help!!!!

Link to comment
Share on other sites

Hello Danp2 sorry it's me again 😞
Unfortunately, I have absolutely no idea how to find the things from my code, as there are so many input options such as:
_WD_GetElementById ($ sSession, $ sID)
_WD_GetElementByName
or somehow different.
  Unfortunately I don't have a plan.
 

I would like to select these things

; ~ Label
; ~ <div class = "assets-favorites__lable"> USD / CHF </div>
; ~ <div class = "assets-favorites__lable"> EUR / USD </div>
; ~ <div class = "assets-favorites__lable"> USD / JPY </div>
; ~ <div class = "assets-favorites__lable"> USD / CAD </div>
; ~ <div class = "assets-favorites__lable"> AUD / USD </div>
; ~ <div class = "assets-favorites__lable"> EUR / AUD </div>
; ~ <div class = "assets-favorites__lable"> EUR / GBP </div>


; ~ Time

; ~ <div class = "value__val"> 00:00 </ div

; ~ Trade amount
; ~ <input type = "text" autocomplete = "off" value = "$ 1">

; ~ Closed couples

; ~ <a> USD / CAD </a>

; ~ Won
; ~ <div class = "price-up"> $ 1.73 </div>

; ~ Buttons
; ~ Call = <a class="btn btn-call">
; ~ Put = <a class="btn btn-put">

 

thanks for your help and time

Link to comment
Share on other sites

@Kepo What's the URL for the website you are wanting to automate? To answer your question, most of those elements can be located using _WD_FindElement with the appropriate xpath.

FWIW, you never need to use _WD_GetElementById , _WD_GetElementByName, etc. These were added to make accessing certain elements easier, but all they do is call _WD_FindElement with some presets.

Link to comment
Share on other sites

The url is https://pocketoption.com/de/login/
then you first come to the registration. I would like that a msgbox opens and you have to enter the email and the password, this should be saved in the script and it should only be able to be changed by the administrator. After registering, you come to another page that is https://pocketoption.com/de/cabinet/ and there would be several things to read out. I think it works the same way

_WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/div[2]/div/div/div/div[3]/form/div[2]/div[1]/input")

just how and where can I get the message that the program has found something? I would also like to have a GUI pastel with radio buttons later so that certain things can be selected separately. I know that there is still a long way to go and I am so grateful for your help.

Link to comment
Share on other sites

A few random thoughts on this --

  • You aren't going to be able to automate the login process because the site uses Captcha
  • Suggest for the purposes of this discussion that you use the demo site (https://pocketoption.com/en/cabinet/demo-high-low/) so that others can see what you are attempting to do without having to setup an account
  • You need to capture the return value form _WD_FindElement into a variable. Also need to check value of @error.
  • Review the examples of using the various UDF functions in wd_demo.au3. Then take those that apply and adapt them to your project
  • You've picked a complex set of tasks as your first project. Please understand that we are here to provide assistance, but you can't expect us to hold your hand for every step of the process.
Link to comment
Share on other sites

now i have already found out something again and have once managed to read out all the things or that the bot finds everything. Now there is only one small problem and I still have to find out how to get a text and not the whole code.
this is what my code looks like from time to time and the captcha is also no problem 🙂
thank you for your help danp2.

#include <wd_core.au3>
#include <wd_helper.au3>
#include <JSON.au3>
#include <WinHttp.au3>
#Include "BinaryCall.au3"
;~ #include <wd_demo.au3>


Local $sDesiredCapabilities, $sSession
Firefox ()



;~ Variablen

$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'
$sData ='{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}'


_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)

_WD_Navigate($sSession, "https://pocketoption.com/en/cabinet/demo-high-low/")

;~ Emaileingeben

$Email = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/div[2]/div/div/div/div[3]/form/div[2]/div[1]/input")
Sleep (300)
$Emaileingabe = InputBox ("Emailadresse eingeben","")
_WD_ElementAction($sSession, $Email, 'value', $Emaileingabe)
Sleep (500)

$Password = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/div[2]/div/div/div/div[3]/form/div[2]/div[2]/input")

$Passworteingabe = InputBox ("Passwordeingabe eingeben","")
_WD_ElementAction($sSession, $Password, 'value', $Passworteingabe)


MsgBox (0, "Cappcha", "fertig gedrückt")

sleep (500)

msgbox (0, "Wähle Favoriten aus", "USD/CHF, EUR/USD, USD/JPY, USD/CAD, AUD/USD, EUR/AUD, EUR/GBP")

sleep (500)
While 1
;~ Finde alle Paare
$LableUSDCHF = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[1]/div/div/div[3]/div/div[1]")
ToolTip($LableUSDCHF)

sleep (500)

$LableEURUSD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[1]/div/div/div[3]/div/div[2]")
ToolTip ($LableEURUSD)

sleep (500)

$LableUSDJPY = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[1]/div/div/div[3]/div/div[3]")
ToolTip ($LableUSDJPY)

sleep (500)

$LableUSDCAD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[1]/div/div/div[3]/div/div[4]")
ToolTip ($LableUSDCAD)

sleep (500)

$LableAUDUSD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[1]/div/div/div[3]/div/div[5]")
ToolTip ($LableAUDUSD)

sleep (500)

$LableEURAUD = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[1]/div/div/div[3]/div/div[6]")
ToolTip ($LableEURAUD)

sleep (500)

$LableEURGBP = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[1]/div/div/div[3]/div/div[7]")
ToolTip ($LableEURGBP)
sleep (500)

;~ Finde Trade Amount

$TradeAmount = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[2]/div[4]/div[2]/div/div/div[1]/div/div[7]/div[2]/div[2]/div/div[2]/div[2]/div/div[1]/div/input")
InputBox ("TradeAmout", $TradeAmount)

sleep (500)

;~ Finde Strike Price
$StrikePrice = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[2]/div[4]/div[2]/div/div/div[1]/div/div[7]/div[2]/div[2]/div/div[3]/div[2]/div/div[1]/div")
MsgBox (0,"Einstiegspreis", $StrikePrice)

sleep (500)

;~ Finde Zeit
$Zeit = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[2]/div[4]/div[2]/div/div/div[1]/div/div[7]/div[2]/div[2]/div/div[1]/div[2]/div/div[1]/div/div[2]")
MsgBox (0,"Zeit", $Zeit)

sleep (500)

;~ GewinnVerlust
$GewinnVerlust = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[2]/div[4]/div[2]/div/div/div[2]/div/div[2]/div/div[3]/div[2]/div[2]")
MsgBox (0,"GewinnVerlust", $GewinnVerlust)

sleep (500)

;~ CallButton
 $CallButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[2]/div[4]/div[2]/div/div/div[1]/div/div[7]/div[2]/div[2]/div/div[5]/a")
 MsgBox (0,"Callbutton", $CallButton)

 sleep (500)

;~  PutButton
$PutButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[4]/div[2]/div[4]/div[2]/div/div/div[1]/div/div[7]/div[2]/div[2]/div/div[4]/a")
MsgBox (0, "Putbutton", $PutButton)

WEnd




func Firefox()
_WD_Option("Driver", "C:\Users\Jürgen\Desktop\Autoit\FireFox\geckodriver.exe")
_WD_Option('DriverParams', '--binary "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" --log trace ')
_WD_Option('Port', 4444)
EndFunc

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...