html - 在 Instagram 上发送消息
问题描述
我正在尝试创建一个 VBA 宏代码,以便在代码中传递的消息可以将代码中定义的配置文件发送给我们配置文件中的每个用户。我正在尝试这样做,首先在 Instagram 和他们上搜索配置文件单击消息选项,然后他们发送消息。但我无法将消息发送到个人资料。
文本区域的 HTML 代码是
<div class="Igw0E IwRSH eGOV_ vwCYk ItkAi">
<textarea class="" style="height: 19px;" placeholder="Message..."> </textarea>
</div>
<hr>
Sub MessageGalGadot()
Url$ = "https://www.instagram.com/XYZ/"
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
解决方案
推荐阅读
- node.js - 无法使用cheerio抓取链接
- angular - 在 Angular 8 中创建 App shell 时出错
- javascript - 渲染文本区域中输入的换行符
- xamarin.forms - 没有第三方库的 xamarin.forms 授权
- python - 没有提供静态文件夹的烧瓶轮文件
- javascript - 手机上无限连续循环滚动
- spring-boot - 如何调试永远不会完成的 Mono
- firebase - Firebase/Firestore 静态加密级别
- postgresql - SQL 中的 MIN 函数未按预期工作
- sql-server - 无法将 Polybase 连接到 PostgreSQL