Function JabberGET(ByVal Urlka As String) As String
Dim objHTTP As Object
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
objHTTP.Open "GET", Urlka, False
objHTTP.setRequestHeader "Accept", "text/html"
objHTTP.setRequestHeader "Accept-Language", "ru-ru,ru"
objHTTP.setRequestHeader "Accept-Encoding", "gzip,deflate"
objHTTP.setRequestHeader "Accept-Charset", "windows-1251"
objHTTP.setRequestHeader "Keep-Alive", "115"
objHTTP.setRequestHeader "Connection", "keep-alive"
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.Send Empty
Debug.Print objHTTP.responseText
JabberGET = objHTTP.responseText
End Function
Dim RegEx As RegExp, RegMatch As MatchCollection
Dim myMatch As Match
Set RegEx = New RegExp
'String to parse
With RegEx
.MultiLine = True
.IgnoreCase = True
.Global = True
End With
RegEx.Pattern = "discipline_id..value=.\d{3,4}.|\s>\s.*<..>"
Set RegMatch = RegEx.Execute(MyStr)
If RegMatch.Count > 0 Then
For Each myMatch In RegMatch
Next
End If
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
Application.DisplayAlerts = False
url = "http://study.engr.pfu.edu.ru/index.php"
IE.Navigate "http://study.engr.pfu.edu.ru/tutor/logout.php"
While IE.Busy: DoEvents: Wend 'wait until IE is done loading page.
IE.Navigate url
Do Until IE.ReadyState = READYSTATE_COMPLETE: Loop
While IE.Busy: DoEvents: Wend 'wait until IE is done loading page.
IE.Visible = True
'ie is now done loading the page
IE.Document.all("valid_tutor_login").Value = getpass(0)
IE.Document.all("valid_tutor_password").Value = getpass(1)
Call ckickBtn("", IE)
While IE.Busy: DoEvents: Wend 'wait until IE is done loading page.
SubjCod = CoursGroupNumber(2, GroupNum)
For Each btn In IE.Document.all.tags("Input")
X = btn.Value
If btn.Value = SubjCod Or btn.Value = CourseNum Then
Call btn.Click
End If
Next btn
Call ckickBtn(">>", IE)
Function ckickBtn(btm As String, IE As InternetExplorer)
For Each btn In IE.Document.all.tags("Input")
X = btn.Value
If btn.Value = btm Then
Call btn.Click
End If
Next btn
While IE.Busy: DoEvents: Wend 'wait until IE is done loading page.
Do Until IE.ReadyState = READYSTATE_COMPLETE: Loop 'Loop unitl ie page is fully loaded
End Function
Source: https://habr.com/ru/post/112259/