- 帖子
- 549
- 主題
- 152
- 精華
- 0
- 積分
- 691
- 點名
- 0
- 作業系統
- WIN7
- 軟體版本
- OFFICE 2010
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2013-8-10
- 最後登錄
- 2022-9-7
 
|
- Sub test()
- 'PS:要自己先用ie開啟https://www.pinkoi.com/網址
- '並且用FB點選登入,不然下列語法將會找不到傳送訊息的部分,要有登入才可傳送訊息給別人
- Set IE = CreateObject("InternetExplorer.Application")
- IE.Visible = True
- IE.Navigate "https://www.pinkoi.com/user/testpkko"
- Do While IE.Busy Or IE.readyState <> 4: DoEvents: Loop
- With IE.Document
- i = 0: On Error Resume Next
- For Each E In .GetElementsByTagName("A")
- A = E.Text
- If CStr(A) = "傳送訊息" Then
- E.Click '這邊呼叫出傳送訊息的視窗
- '要如何控制該視窗輸入主旨+內文+選擇檔案呢?
-
- Call WEB_DETAIL(IE) '我用網頁元素的部分無法查不出相關資訊
- End If
- Next
- End With
- End Sub
複製代碼- Sub WEB_DETAIL(IE)
- With IE
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- With .Document
- i = 0: On Error Resume Next
- For Each E In .ALL
- i = i + 1
- Cells(i, "a") = E.tagname
- Cells(i, "b") = E.ID
- Cells(i, "c") = E.Name
- Cells(i, "d") = E.Value
- Cells(i, "e") = E.innertext
- Cells(i, "f") = E.Type
- Cells(i, "g") = E.href
- Cells(i, "H") = E.Text
- Next
- End With
- End With
- End Sub
複製代碼 |
|