问题
I am trying to create a VBA macro code, so that the Message passed in the code can send of the profile defined in the code, to every user in our profile.
I am trying doing these, by first searching the profile on Instagram and them clicking on message option and them sending the message. But i am not able to send the message to the profile.
The HTML code of text area is
<div class="Igw0E IwRSH eGOV_ vwCYk ItkAi">
<textarea clas="" style="height: 19px;" placeholder="Message...">
</textarea>
</div>
Sub MessageGalGadot()
Url$ = "https://www.instagram.com/motos.22.nova/"
Dim ie As New InternetExplorer, post As Object
Dim WebUrl As String
Dim i As Integer
With ie
.Visible = True
.Navigate Url
While .Busy = True Or .readyState < 4: DoEvents: Wend
While post Is Nothing
On Error Resume Next
Application.Wait Now + TimeValue("00:00:001")
Set post = .Document.querySelector(".fAR91.sqdOP.L3NKy._4pI4F._8A5w5 ")
If Not post Is Nothing Then
post.Click
Set msg = .Document.querySelector(".Igw0E.IwRSH.eGOV_.vwCYk.ItkAi ")
msg.Click
ie.Document.getElementsByName(".Igw0E.IwRSH.eGOV_.vwCYk.ItkAi").Value = "123"
Else:
Debug.Print "trying again"
End If
On Error GoTo 0
Wend
End With
Stop
ie.Quit
End Sub
来源:https://stackoverflow.com/questions/62403190/send-message-on-instagram-profile