標題:
[發問]
如何用下載的方式,卻又可以登入網站?
[打印本頁]
作者:
PKKO
時間:
2016-10-25 11:30
標題:
如何用下載的方式,卻又可以登入網站?
小弟已經透過網頁元素可以用下列方式登入成功
Sub TEST()
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "https://en.surebet.com/users/sign_in"
Do While .Busy Or .readyState <> 4: DoEvents: Loop
With .Document
.GetElementByid("user_email").Value = "
[email protected]
" '帳號
.GetElementByid("user_password").Value = "XXX" '密碼
.GetElementByid("sign_in_user").Click
End With
End With
End Sub
複製代碼
但是資料的部分想要用下列的下載方式
Sub TEST2()
Dim QT As QueryTable
Dim WebAddress As String
'登入網址:https://en.surebet.com/users/sign_in
'目的地網址:https://en.surebet.com/surebets/group?controller=surebets&like=562651712
WebAddress = ""
With ThisWorkbook.Worksheets("下載")
.Cells.Clear
Set QT = .QueryTables.Add("URL;" & WebAddress, .range("$A$1"))
End With
With QT
'.PostText = 這邊不知道要如何輸入帳號+密碼
'這邊也不曉得該如何按下登入的按鈕
'以及不曉得登入之後要如何轉向第二個網址?
.WebTables = "2"
.Refresh False
.Delete
End With
End Sub
複製代碼
但卻無法登入網站,請問要如何透過下載的方式來登入網站並轉換第二個網址呢?
還是有大大可以透過第一個網頁元素的方式,然後透過該ie直接用第二個方式下載?
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)