saeelo
asked on
URL search
experts,
I have been working on a google URL extractor i need your help with link search:
what i want to do now just add to the listbox all the link that contain :"asp?=" i am not able to find a way i thought of using a inbetween technique but it wont work because i never know how is the end of the link, any advise?
I have been working on a google URL extractor i need your help with link search:
what i want to do now just add to the listbox all the link that contain :"asp?=" i am not able to find a way i thought of using a inbetween technique but it wont work because i never know how is the end of the link, any advise?
' visual basic 6.0
For x = 0 To WebBrowser1.Document.links.length - 1
If Left(WebBrowser1.Document.links(x), 9) <> "http://74" And Left(WebBrowser1.Document.links(x), 17) <> "http://www.google" And Left(WebBrowser1.Document.links(x), 18) <> "https://www.google" And Left(WebBrowser1.Document.links(x), 13) <> "http://images" And Left(WebBrowser1.Document.links(x), 11) <> "http://news" And Left(WebBrowser1.Document.links(x), 13) <> "http://groups" And Left(WebBrowser1.Document.links(x), 11) <> "http://mail" And Left(WebBrowser1.Document.links(x), 11) <> "http://docs" And Left(WebBrowser1.Document.links(x), 14) <> "http://scholar" And Left(WebBrowser1.Document.links(x), 12) <> "http://sites" And Left(WebBrowser1.Document.links(x), 16) <> "http://translate" Then
Debug.Print WebBrowser1.Document.links(x)
End If
Next
ASKER
i will try it now praveenvenu thank you i ll keep u updated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First: Instead of using Left(...) try using x.Startwith("http://...)
Second, use a x.Contains("asp?=") to detect if it is an asp page.
Second, use a x.Contains("asp?=") to detect if it is an asp page.
ASKER
yes it is vb6.0
thank you guys for helping, but still i tried to implement the x.contains ("asp?=) it gave me a mismatch error what i am trying to do now is just to populate a listbox with all the .asp page that has parameters. and ignore the rest. i just can't find the right way. i ll try to use x.startwith rseabird just trying to find a solution for this problem
thank you for ur help
thank you guys for helping, but still i tried to implement the x.contains ("asp?=) it gave me a mismatch error what i am trying to do now is just to populate a listbox with all the .asp page that has parameters. and ignore the rest. i just can't find the right way. i ll try to use x.startwith rseabird just trying to find a solution for this problem
thank you for ur help
Private Sub Command1_Click()
Dim oLink As Object
WebBrowser1.Navigate Text1.Text
Do While WebBrowser1.Busy
DoEvents
Loop
For x = 0 To WebBrowser1.Document.links.length - 1
If Left(WebBrowser1.Document.links(x), 9) <> "http://74" And Left(WebBrowser1.Document.links(x), 17) <> "http://www.google" And Left(WebBrowser1.Document.links(x), 18) <> "https://www.google" And Left(WebBrowser1.Document.links(x), 13) <> "http://images" And Left(WebBrowser1.Document.links(x), 11) <> "http://news" And Left(WebBrowser1.Document.links(x), 13) <> "http://groups" And Left(WebBrowser1.Document.links(x), 11) <> "http://mail" And Left(WebBrowser1.Document.links(x), 11) <> "http://docs" And Left(WebBrowser1.Document.links(x), 14) <> "http://scholar" And Left(WebBrowser1.Document.links(x), 12) <> "http://sites" And Left(WebBrowser1.Document.links(x), 16) <> "http://translate" Then
Debug.Print WebBrowser1.Document.links(x)
End If
Next
MsgBox "done"
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you looked to my solution ?
ASKER
thank you guys, i splited the point between you 2 because both of the comments were helpfull thank you so much again
Glad I could help!
Contains(), StartWith, IndexOf() are all methods of .NET. Since you have choose an .NET zone, almost all the comments where in .NET.
Contains(), StartWith, IndexOf() are all methods of .NET. Since you have choose an .NET zone, almost all the comments where in .NET.
(WebBrowser1.Document.link
this will return true if it contains the string "asp?"