Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 07:32

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Winhttp / JavaScript Enablend

Discussion on Winhttp / JavaScript Enablend within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
emil's Avatar
 
elite*gold: 520
Join Date: Aug 2006
Posts: 65
Received Thanks: 5
Winhttp / JavaScript Enablend

Hallo ich mal schon wider,
ich hab nen neues Problem mittlerweile klapt das mit dem Einloggen vom Bot aber jetzt bekomme ich die Fehlermeldung:

Code:
Your web browser musst have JavaScript enabled in order for this application to display correctly.
Er gibt mir nur ein Teil der Seite aus, brauche aber die Daten für den weiteren verlauf.

Hier mal das Script soweit, ist bestimmt nicht perfekt aber ich bin am Lernen

Code:
#include <WinHTTP.au3>
#include <Array.au3>
#include <String.au3>

Global $HTML = ""
global $sHTML = ""
Global $WinHTTP_Host = "battleofcrowns.com"
Global $WinHTTP_Host1 = "belize3.de.battleofcrowns.com"
Global $WinHTTP_Client = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0")
Global $WinHTTP_Connect1 = _WinHttpConnect($WinHTTP_Client, $WinHTTP_Host1)                      
Global $WinHTTP_Connect = _WinHttpConnect($WinHTTP_Client, $WinHTTP_Host)
Global $sToken = ""
Global $Gamelink = ""
Global $OAuth = 'Authorization: Bearer '
Global $sID = ""


While 19 ; Die "normale" Hauptschleife
; Wir führen nacheinander die Funktionen aus
    _Login()
    ClipPut(_Abfrage()) ; Die Ergebnisse - Code den packen wir uns zum Testen immer in den Zwischenspeicher (finde ich besser als FileWrite!)
    Exit
WEnd

Func _Login()
    $HTML = Win_GET_To("battleofcrowns.com", "/de/") ;STARTSEITE
    $HTML = Win_GET_To("battleofcrowns.com", "/de/?popup=login") ;POPUP
    $HTML = Win_POST_To("battleofcrowns.com", "/public/api/login",'{"email":"","password":"12345678"}')
$tokenabfrage =  StringRegExp($HTML , '"token":"(.+?)"', 3) ; Token wird ausgelesen
	If IsArray($tokenabfrage) Then
    $sToken = $tokenabfrage[0]
EndIf	
$deine_Id =  StringRegExp($HTML , '"playerId":(.+?),"', 3) ; PlayerId wird ausgelesen
    If IsArray($deine_Id) Then
    $sID = $deine_Id[0]
EndIf
	$HTML = _WinHttpSimpleRequest($WinHTTP_Connect,"GET", "/public/api/player/"& $sID & "/gameclientlink?domain=belize3.de.battleofcrowns.com&_=1377532546574","/de/?page=serverList" & @CRLF & $OAuth & $sToken)
$Si = StringRegExp($HTML , '/gameserver/game.jsp\?user=(.+?)%3D%3D', 3) ; Gamelink wird ausgelesen
	If IsArray($Si) Then
    $Gamelink = $Si[0]
 EndIf

    $sHTML = _WinHttpSimpleRequest($WinHTTP_Connect1,"GET",'/gameserver/game.jsp?user=' & $Gamelink & '%3D%3D&w=1920&h=1080&pixelRatio=1',"/de/?page=serverList" & "&useCookies=1&url=") 
    ;$a = _StringBetween($HTML,'<html style="overflow: hidden;">"','"</html>')
    ;ConsoleWrite($HTML)
	
	;<------------ hier bleibe ich hängen >-------------------------------------------------------
	
	
    MsgBox(0, "POST-Login", $sHTML) ; nur zum Testen
    FileWrite("Login.html", $sHTML) ; nur zum Testen
 




 
 ;$sHTML = _WinHttpSimpleRequest($WinHTTP_Connect1,"GET",'/gameserver/cc/service/init', '/gameserver/game.jsp?user=' & $Gamelink & '%3D%3D&w=1920&h=1080&pixelRatio=1')

EndFunc	
	


Func _Abfrage()
   
    MsgBox(0, "Token.txt", $sToken) ; nur zum Testen
	MsgBox(0, "playerId", $sID) ; nur zum Testen
	MsgBox(0, "Gamelink", $Gamelink) ; nur zum Testen
	
   
  
   ;$aReturn = StringRegExp($shtml , '<div class="HudProfile-Gold-Icon">(\d+?)</div>', 3)
   ;MsgBox(64, "Goldbetrag", $aReturn[0]) ; nur zum Testen   	
EndFunc	


Func Win_GET_To($sHost, $sSite)
    If Not ($sHost = $WinHTTP_Host) Then
        $WinHTTP_Host = $sHost
        $WinHTTP_Connect = _WinHttpConnect($WinHTTP_Client, $WinHTTP_Host)
	 EndIf
     $WinHTTP_Request = _WinHttpOpenRequest($WinHTTP_Connect, "GET", $sSite, "HTTP/1.1", $sHost)
	_WinHttpSendRequest($WinHTTP_Request)
	_WinHttpReceiveResponse($WinHTTP_Request)
  Local $sHTML = ""
    Do
        $sHTML &= _WinHttpReadData($WinHTTP_Request)
    Until @error
    Return $sHTML
EndFunc   ;==>Win_GET_To1


Func Win_POST_To($sHost, $sSite, $sPost)
    If Not ($sHost = $WinHTTP_Host) Then
        $WinHTTP_Host = $sHost ; Neuen Host bestimmen
        $WinHTTP_Connect = _WinHttpConnect($WinHTTP_Client, $WinHTTP_Host)
    EndIf
    $WinHTTP_Request = _WinHttpOpenRequest($WinHTTP_Connect, "POST", $sSite, "HTTP/1.1", $sHost)
    _WinHttpSendRequest($WinHTTP_Request, "Content-Type: application/json; charset=UTF-8" & @CRLF, $sPost)
    _WinHttpReceiveResponse($WinHTTP_Request)
	Local $sHTML = ""
	Do
	   $sHTML &= _WinHttpReadData($WinHTTP_Request)
    Until @error
    Return $sHTML
 EndFunc   ;==>Win_POST_To

_WinHttpCloseHandle($WinHTTP_Connect, $WinHTTP_Connect1)
_WinHttpCloseHandle($WinHTTP_Client)
hat wer ne Idee was ich falsch mache, Danke im vorraus
emil is offline  
Reply


Similar Threads Similar Threads
Web.de Captcha|Winhttp
06/28/2013 - AutoIt - 3 Replies
Huhu, da ich gerade an einem web.de acc creator sitze und ich sozusagen fast fertig bin, ich allerdings nur net das Captcha heruntergeladen bekomme in meine Gui wollte ich fragen ob mir jemand evtl helfen kann: aktueller Versuch Captcha in txt. Datei zu schreiben. Func _Captcha() For $i = 1 To 1 Step 1 $aSession = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0") $aConnect = _WinHttpConnect($aSession, "registrierung.web.de")
WinHTTP.au3 und EPVPIMG.com
04/06/2013 - AutoIt - 11 Replies
Hi epvp! Ich möchte mit der WinHTTP.au3 ein Bild auf epvpImg: le image upload ^_^ hochladen :) Ist das möglich? LiveHTTPHeaders: http://epvpimg.com/upload/ POST /upload/ HTTP/1.1 Host: epvpimg.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Suche WinHTTP.au3
03/12/2012 - AutoIt - 1 Replies
HEy, wie der Titel schon sagt suche ich die WinHTTP.au3 include datei. Wäre nett wenn mir die jemand uploadet lg
Help with winhttp
09/21/2011 - AutoIt - 5 Replies
Hi there, I'm trying to learn winhttp functions from winhttp udf. I would like to automate facebook forms with it. but i don't know how to get fb forms info for headers and etc. does anyone here knows a good documentation or even better a working example code for fb? -Note: i've tried wireshark but it doesnt support my network interface.
WINHTTP.dLL
07/02/2006 - Technical Support - 2 Replies
Hilfe Ich da ich heute Formatiert habe und alles neu drauf laden musste usw..... hab ich nun ein neues problem MSN will nicht Starten begründung winHTTP.dll wurde nicht gefunden!



All times are GMT +2. The time now is 07:32.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.