E
Erica Roberts
I am attempting to write some code that auto submits to a few search
engines. The code is crashing when submitting to DMOZ on the
wbbrowser.document.all("submit").click() line. This same line of code works
on Yahoo but not when done the 2nd time under DMOZ. My code is below. the
DMOZ Code is the last set.
The error I am getting is Public member 'click' on type
'DISPHTMLELEMENTCollection' no found.
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdStart.Click
Dim i As Integer
Dim SubUrl As String
Dim SubName As String
Dim SubTitle As String
Dim SubDesc As String
Dim SubEmail As String
Dim SubKeywords As String
If Me.lsvDomains.Items.Count > 0 Then
For i = 0 To Me.lsvDomains.Items.Count - 1
If Me.lsvDomains.Items(i).Checked Then
SubUrl = Me.lsvDomains.Items(i).Text
SubTitle = Me.lsvDomains.Items(i).SubItems(1).Text
SubName = Me.lsvDomains.Items(i).SubItems(2).Text
SubEmail = Me.lsvDomains.Items(i).SubItems(3).Text
SubDesc = Me.lsvDomains.Items(i).SubItems(4).Text
''********Submit to Yahoo
Dim URL As String = "http://add.yahoo.com/fast/add?158789" '
Dim Flags As Integer = 0
Dim TargetFrame As String = ""
Dim PostData As Object =
"category=Reference&spaceid=158789&noexpress=1&class=YHOO&pass=2"
PostData = System.Text.Encoding.GetEncoding(1252).GetBytes(PostData)
Dim Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
Me.wbBrowser.Navigate(URL, Flags, TargetFrame, PostData, Headers)
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
wbBrowser.Document.All("title").Value = SubTitle
wbBrowser.Document.All("url").Value = "http://" + SubUrl
'wbBrowser.Document.All("location").Value = txtlocation.Text
wbBrowser.Document.All("comments").Value = SubDesc
wbBrowser.Document.All("name").Value = SubName
wbBrowser.Document.All("email").Value = SubEmail
wbBrowser.Document.All(".submit").Click()
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
''******Google.com
Me.wbBrowser.Navigate("http://www.google.com/addurl?q=http://" +
SubUrl + "&dq=&submit=Add+URL")
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
''*****Dmoz.com (Open Directory Project)
wbBrowser.Navigate("http://dmoz.org/cgi-bin/add.cgi?where=Regional/North_Ame
rica/United_States/Ohio/Business_and_Economy/Real_Estate")
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
wbBrowser.Document.all("url").value = SubUrl
wbBrowser.Document.all("title").value = SubTitle
wbBrowser.Document.all("description").value = SubDesc
wbBrowser.Document.all("email").value = SubEmail
wbBrowser.Document.all("submit").click()
End If
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
Next
End If
End Sub
engines. The code is crashing when submitting to DMOZ on the
wbbrowser.document.all("submit").click() line. This same line of code works
on Yahoo but not when done the 2nd time under DMOZ. My code is below. the
DMOZ Code is the last set.
The error I am getting is Public member 'click' on type
'DISPHTMLELEMENTCollection' no found.
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdStart.Click
Dim i As Integer
Dim SubUrl As String
Dim SubName As String
Dim SubTitle As String
Dim SubDesc As String
Dim SubEmail As String
Dim SubKeywords As String
If Me.lsvDomains.Items.Count > 0 Then
For i = 0 To Me.lsvDomains.Items.Count - 1
If Me.lsvDomains.Items(i).Checked Then
SubUrl = Me.lsvDomains.Items(i).Text
SubTitle = Me.lsvDomains.Items(i).SubItems(1).Text
SubName = Me.lsvDomains.Items(i).SubItems(2).Text
SubEmail = Me.lsvDomains.Items(i).SubItems(3).Text
SubDesc = Me.lsvDomains.Items(i).SubItems(4).Text
''********Submit to Yahoo
Dim URL As String = "http://add.yahoo.com/fast/add?158789" '
Dim Flags As Integer = 0
Dim TargetFrame As String = ""
Dim PostData As Object =
"category=Reference&spaceid=158789&noexpress=1&class=YHOO&pass=2"
PostData = System.Text.Encoding.GetEncoding(1252).GetBytes(PostData)
Dim Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
Me.wbBrowser.Navigate(URL, Flags, TargetFrame, PostData, Headers)
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
wbBrowser.Document.All("title").Value = SubTitle
wbBrowser.Document.All("url").Value = "http://" + SubUrl
'wbBrowser.Document.All("location").Value = txtlocation.Text
wbBrowser.Document.All("comments").Value = SubDesc
wbBrowser.Document.All("name").Value = SubName
wbBrowser.Document.All("email").Value = SubEmail
wbBrowser.Document.All(".submit").Click()
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
''******Google.com
Me.wbBrowser.Navigate("http://www.google.com/addurl?q=http://" +
SubUrl + "&dq=&submit=Add+URL")
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
''*****Dmoz.com (Open Directory Project)
wbBrowser.Navigate("http://dmoz.org/cgi-bin/add.cgi?where=Regional/North_Ame
rica/United_States/Ohio/Business_and_Economy/Real_Estate")
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
wbBrowser.Document.all("url").value = SubUrl
wbBrowser.Document.all("title").value = SubTitle
wbBrowser.Document.all("description").value = SubDesc
wbBrowser.Document.all("email").value = SubEmail
wbBrowser.Document.all("submit").click()
End If
Do
Application.DoEvents()
Loop While Me.wbBrowser.Busy
Next
End If
End Sub