none
Extracting emails from webbrowser1..........

    Question

  • Hello great programmers, i have a problem with coding my application and i need your help.

    i have tried everything that is to e found on the internet for it but it seems that all is not working but recently this is what add to my button event.

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
            Dim instream As StreamReader
            Dim webrequest As WebRequest
            Dim webresponse As WebResponse
            webrequest = webrequest.Create(TextBox1.Text)
            webresponse = webrequest.GetResponse()
            Dim adrRx As Regex = New Regex("\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\b")
            instream = New StreamReader(webresponse.GetResponseStream())
            ListBox1.Items.Add(instream.ReadToEnd())

            Dim emails As New List(Of String)
            For Each item As Match In adrRx.Matches("\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\b")
                emails.Add(item.Value)
            Next
            Dim emailsString As String = Join(emails.ToArray, ",")
        End Sub

    what i wanted really is that when i go to a webpage in my application and then click a button, i want it to extract all mails in the page. just like a similar application i saw online but my application is  just displaying  Doctype><html

    Please, i need your help in coding my application so that in a click of a button all emails will be extracted into a datagridview and when it is extracting i want it to be visible line by line so that you can know that it is working because my application can't do that and it keeps returning that i have a lot of load on my application and that it has to shut down. please help me out.

    Again, i don't know which resources to add to my application because if i run it, it do seize

    Henry



    Monday, July 29, 2013 4:25 PM

Answers

All replies

  • Hi Henry,

    Did you mean search a webpage and find out all email addresses, and then add the email address to ListBox ?

    Thanks a lot

    Tina.Lee

    Wednesday, July 31, 2013 9:18 AM
  • my application has a browser so if i go to a page in the browser, i want that when i click a button.... the emails in the site i have gone to will be extracted into a listbox or into a datagrid.

    pls help me out

    Saturday, August 03, 2013 12:57 PM
  • my application has a browser so if i go to a page in the browser, i want that when i click a button.... the emails in the site i have gone to will be extracted into a listbox or into a datagrid.

    pls help me out

    There are lots of tutorials about this. There is one such tutorial here:

    http://www.dreamincode.net/forums/topic/160644-creating-a-web-spider/


    “If you want something you've never had, you need to do something you've never done.”

    Don't forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.

    Saturday, August 03, 2013 4:20 PM
    Moderator
  • I will try it and get back to you.. but for the main time.. Thank you for the link.
    Saturday, August 03, 2013 4:44 PM
  • Hello Great Great Programmers, Please help me with also a VB code that opens the extracted links and brings out the email through regex.

    please, help me out ..... this is what i have for now

    ListBox1.Items.Clear()
            Dim strreg As String
            strreg = "\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\b"
            Dim reg As New Regex(strreg, RegexOptions.IgnoreCase)
            Dim m As Match = reg.Match(websource)
            While m.Success
                ListBox1.Items.Add(m.Groups(1).Value)
                m = m.NextMatch()

    i want it to extract the links and then open the links to search for the regex expression and then list it in the listbox
    Saturday, August 24, 2013 2:52 AM
  • and also can you please tell me the regex expression for this email please.

    i have tried but to no avail.

    email :  we34r-1234567890@sale.craigslist.org

    i tried the regex below but it did not work.. please i need help from you all great programmers.

    regex :    "[a-z0-9.-]+\-[0-9.-]+@[a-z.-]+\.[a-z0-9.-]+\.[a-z]{2,3}"

    Sunday, August 25, 2013 11:05 AM