我需要从我在Power Editor中创建的受众中获取受众群体ID,但我找不到检索受众ID的方法.我已经阅读了https://developers.facebook.com/docs/reference/ads-api/custom-audience-targeting/,但它仍然没有解释从哪里获取这些受众ID.
我写了一个宏,它将打开一个网页,找到我需要放入数据的点,然后我想让宏点击一个预填充按钮,然后点击确定.
该按钮的页面源代码是:
<input type="text" size="30" maxlength="40" name="name" id="name">
<input type="button" value="Prefill" onclick="prefill()">
Run Code Online (Sandbox Code Playgroud)
我整个星期都在寻找答案,我想我已经基本了解了这应该是如何通过运行循环来搜索它,但我没有运气,我的努力实际上让它工作.
有人能告诉我将在我的页面上搜索此按钮的循环吗?
先感谢您.
到目前为止请求的代码
Private Sub Populate_Click()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "website" 'make sure you've logged into the page
Do
DoEvents
Loop Until IE.READYSTATE = 3
Do
DoEvents
Loop Until IE.READYSTATE = 4
ActiveSheet.EnableCalculation = False
ActiveSheet.EnableCalculation = True
Call IE.document.getelementbyid("name").SetAttribute("value", ActiveSheet.Range("b2").Value)
Call IE.document.getelementbyid("aw_login").SetAttribute("value", ActiveSheet.Range("a2").Value)
Set objCollection = …Run Code Online (Sandbox Code Playgroud) Application.SendKeys"{PGDN}",True
工作得很好,但是Application.SendKeys"{%TAB}",True和Application.SendKeys"%{TAB}",True什么都不做.
如何使用sendkeys执行alt-tab切换窗口?
这是代码:
Application.SendKeys "{PGDN}", True
Application.SendKeys "{PGDN}", True
xreply = MsgBox("Is this page for women? Record:" & i, vbYesNo, "Gender Checker")
If xreply = vbYes Then
ActiveSheet.Range("C" & i).Value = vbYes
End If
Run Code Online (Sandbox Code Playgroud) Private Sub CommandButton1_Click()
Dim i As Long
Dim xreply As Integer
Dim names As Long
Dim IE As Object
i = ActiveSheet.Range("D1").Value
While Not IsEmpty(ActiveSheet.Range("A" & i).Value)
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "WEBSITENAME" & ActiveSheet.Range("A" & i).Value
'wait for webpage to load
Do
DoEvents
Loop Until IE.READYSTATE = 4
'pagedown to the info
Application.SendKeys "{PGDN}", True
Application.SendKeys "{PGDN}", True
xreply = MsgBox("Is this page for women? Record:" & i, vbYesNo, "Checker")
Application.Visible = True
AppActivate ("Checker")
If …Run Code Online (Sandbox Code Playgroud)