HelpSearching A Webpage

Posts 1–10 of 10 · Page 1 of 1
Searching A Webpage
I'm trying to find a code that searches a web page for a specific image. I've tried a quite a few things... No luck :x

For example, I'm looking for-
If Picture.IsFound Then
Label1.Text = "Found!"
Else
Label1.Text = "Not found!"
End If
Upload image to TinEye Reverse Image Search for checking if the image exists on web. This can be done easily using visual basic. If the page returns images, loop through them using the webpage source code and incorporate it in your application.
Im still confused about what you want to do, Sorry for being so dense, I understand the "concept" but there are not enough details.

A. Are you searching a specific site?
(or perhaps a list of specific sites)
B. Are you searching the entire web for an image.

C. Do you know the (possible) Id of the image.
D. do you know the "saved name" of the image (IE: movieimage.gif)

These things can help us to help you write the code to do what you want.

@Hassan, Depending on the answers to the above question , tineye may not be necessary, image comparison is not complicated code wise, there has been many applications built using simple comparison algorithms, Like Basic Finger Print Image comparison, Facial comparison and numerous other image based bio-metrics.

I'm not saying that your method isn't good, in fact, it's a good idea, nor to I think my route the best route, but we can't really determine that with his basic information he has provided, I would like more information.

@
PepsiXHacker The only thing I can be sure of in your post is you understand the basic concept of logic (lol)
Quote Originally Posted by NextGen1 View Post
Im still confused about what you want to do, Sorry for being so dense, I understand the "concept" but there are not enough details.

A. Are you searching a specific site?
(or perhaps a list of specific sites)
B. Are you searching the entire web for an image.

C. Do you know the (possible) Id of the image.
D. do you know the "saved name" of the image (IE: movieimage.gif)

These things can help us to help you write the code to do what you want.

@Hassan, Depending on the answers to the above question , tineye may not be necessary, image comparison is not complicated code wise, there has been many applications built using simple comparison algorithms, Like Basic Finger Print Image comparison, Facial comparison and numerous other image based bio-metrics.

I'm not saying that your method isn't good, in fact, it's a good idea, nor to I think my route the best route, but we can't really determine that with his basic information he has provided, I would like more information.

@
PepsiXHacker The only thing I can be sure of in your post is you understand the basic concept of logic (lol)
Yes, I'm pretty much making a different method of making a CBL Checker. I'm going to search the webpage for the Clean Image, Dirty, Banned, or Name Change. Knowing that, it's simple to get the image names. The only thing I can't figure out is, how to find the image, and once you find it, make the text (label1) say clean, dirty etc.
Okay, So I think I (we) got it wrong, your not trying to do a managed GDI+ pixel by pixel comparison, your just looking to scan some HTML for a img (specific) and place it somewhere.

In that case, it becomes much less complicated.

Your best bet is to parse the HTML , Then look for a specific element that is true for all images.
You can use webelements in vb.net and just search for something that .contains.

Example:

If i was going to look on this page for Avatars & pass them into a datagrid I would parse the HTML , then populate the datagrid with all images that have alt tags that contain the word avatar
do you think find image in google?
Process.Start "link"
Quote Originally Posted by Zvonimir Cro View Post
do you think find image in google?
Process.Start "link"
That's not what I'm getting at, I'm not trying open an image, I'm trying to search for one.
Code:
Public Enum CBLStatus
    Clean
    Dirty
    Unknown
End Enum

Public Structure CBLData
    Public Status As CBLStatus
    Public NameChange As Boolean
End Structure

Private Function GetCBLData(ByVal playerName As String) As CBLData
    Dim data As New CBLData
    data.NameChange = False

    Try
        Dim pageResult As String = New WebClient().DownloadString("http://player.thecbl.net/" + playerName)
        data.NameChange = pageResult.Contains("name_change.png")

        If pageResult.Contains("CBL Dirty") Then 
            data.Status = CBLStatus.Dirty
        Else If pageResult.Contains("CBL Clean") Then
            data.Status = CBLStatus.Clean
        Else
            data.Status = CBLStatus.Unknown
        End If
    Catch
        data.Status = CBLStatus.Unknown
    End Try
    Return data
End Function
Code:
Private Sub SomeCrap()
    Dim data As CBLData = GetCBLData("xxSomePlayerxx")
    If data.Status = CBLStatus.Dirty Then
        ' Blah blah.
    ElseIf data.Status = CBLStatus.Clean Then
        ' Blah blah.
    Else
        ' This is when something happened when trying to download the page.
    End If
    lblNameChange.Text = "Name Change? " + data.NameChange.ToString()
End Sub
Something like that? I wrote this code without an IDE (directly in the reply box) so I don't know if it works or has syntax errors. :3
Quote Originally Posted by master131 View Post
Code:
Public Enum CBLStatus
    Clean
    Dirty
    Unknown
End Enum

Public Structure CBLData
    Public Status As CBLStatus
    Public NameChange As Boolean
End Structure

Private Function GetCBLData(ByVal playerName As String) As CBLData
    Dim data As New CBLData
    data.NameChange = False

    Try
        Dim pageResult As String = New WebClient().DownloadString("http://player.thecbl.net/" + playerName)
        data.NameChange = pageResult.Contains("name_change.png")

        If pageResult.Contains("CBL Dirty") Then 
            data.Status = CBLStatus.Dirty
        Else If pageResult.Contains("CBL Clean") Then
            data.Status = CBLStatus.Clean
        Else
            data.Status = CBLStatus.Unknown
        End If
    Catch
        data.Status = CBLStatus.Unknown
    End Try
    Return data
End Function
Code:
Private Sub SomeCrap()
    Dim data As CBLData = GetCBLData("xxSomePlayerxx")
    If data.Status = CBLStatus.Dirty Then
        ' Blah blah.
    ElseIf data.Status = CBLStatus.Clean Then
        ' Blah blah.
    Else
        ' This is when something happened when trying to download the page.
    End If
    lblNameChange.Text = "Name Change? " + data.NameChange.ToString()
End Sub
Something like that? I wrote this code without an IDE (directly in the reply box) so I don't know if it works or has syntax errors. :3
Thanks for typing all this out. Thanks + Rep.
Anywho, this is a bit more advanced of my knowledge. So to understand how this works, the program downloads the page and searches for the image name. But, you only have Name Change in there, would I have to include all image names?
I also am not sure what the second code is for, but I'm guessing it's another example?
The second part is just an example. It has Clean/Dirty checking too, it just reads the data from the page's source.
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us