XMLHTTP 通过谷歌登录

时间:2021-02-06 10:04:51

标签: vba authentication xmlhttprequest

我正在尝试通过谷歌登录。

Sub logingoogle()

Dim http As MSXML2.XMLHTTP60
Dim logUrl As String
Dim gmemail As String, gmPass As String

Set http = New MSXML2.XMLHTTP60

gmemail = "...@gmail.com": gmPass = "..."

logUrl = "https://accounts.google.com/o/oauth2/auth/identifier?response_type=code&client_id=527366819386-ij2okh8sr317p2qnuf4a9murf3afjbh9.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fbetsapi.com%2Fauth%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline&state=HA-B86CUMHKJPD5IASVO4WT120X9QRFGZN7YE3L&flowName=GeneralOAuthFlow"

http.Open "POST", logUrl, False
http.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
http.send "email=" & gmUser
Do Until http.readyState = 4
    DoEvents
Loop
html.Body.innerHTML = http.responseText

Debug.Print http.responseText
    
End Sub

结果如下:

错误 400(错误请求)!!1*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px} body{color:#222;text-align:unset;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px;}* > body{background:url(//www .google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}pre{white-space:pre-wrap;}ins {color:#777;text-decoration:none}一个 img{border:0}@media 屏幕和 (max-width:772px){body{background:none;margin-top:0;max-width:none;padding -right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (最小分辨率:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 无重复 0% 0%/100% 1 00%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel- ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}# logo{display:inline-block;height:54px;width:150px}

400. 这是一个错误。

服务器无法处理请求,因为它的格式不正确。不应重试。我们知道的就这些。

网站是 https://betsapi.com/ 这是登录页面的链接,其中 google 链接 https://betsapi.com/login

请原谅我的拙劣技能

0 个答案:

没有答案