Is .NET the right language for this?

it_guy

New member
Joined
Feb 6, 2009
Messages
3
Programming Experience
Beginner
I need to write an app that will go through each candidate one by one on a job board like Monster.com and retrieve all of their info, then store it in a local database on a PC where the info can be exported to Excel.

Is vb.net the right app for this? I know some PHP but that is about it, so just would like to find out before I start learning.


Thank you,
Bobby
 
VB.NET can certainly do the job. If there's a web service available (which I doubt) then you can connect to it to get the information. Otherwise, you can use a WebClient to download the contents of a web page and write code to scrape it. The Regex class provides regular expression support so you can use complex criteria to pick out text between specific tags in HTML code.
 
ok thanks i will try it then. what apps do i need to start writing and compiling vb.net? is the webclient and regex class included in these?



thanks,
bobby
 
VB 2008 Express is a free IDE from Microsoft for creating non-Web applications and libraries in VB 2008. When you install it you will also install version 3.5 of the .NET Framework, which includes the .NET class libraries, which include the WebClient and Regex classes. I'd suggest you get yourself a beginner's book or find some beginner tutorials online and just work through them to get the basics of the language first.

Downloads

Make sure you follow the link provided on that page to download and install the documentation library too.
 
i found an example of webclient code that fetches code for a uri. i opened a candidate on monster.com and ran it for that address and got back all script and no resume text.

here is the code i am using. i have a basic understanding of how it works and why this is happening but not sure how to interpret the script i am getting back from monster into text - any ideas?


thanks,
bobby


VB.NET:
Imports System.Net
Imports System.IO
'Imports System.Text

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents txtURI As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents txtResults As System.Windows.Forms.TextBox
    Friend WithEvents btnFetch As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.txtURI = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.btnFetch = New System.Windows.Forms.Button
        Me.txtResults = New System.Windows.Forms.TextBox
        Me.SuspendLayout()
        '
        'txtURI
        '
        Me.txtURI.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.txtURI.Location = New System.Drawing.Point(40, 8)
        Me.txtURI.Name = "txtURI"
        Me.txtURI.Size = New System.Drawing.Size(368, 20)
        Me.txtURI.TabIndex = 3
        Me.txtURI.Text = "http://www.vb-helper.com/quickbrown.txt"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(8, 8)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(24, 16)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "URI"
        '
        'btnFetch
        '
        Me.btnFetch.Anchor = System.Windows.Forms.AnchorStyles.Top
        Me.btnFetch.Location = New System.Drawing.Point(176, 32)
        Me.btnFetch.Name = "btnFetch"
        Me.btnFetch.Size = New System.Drawing.Size(64, 23)
        Me.btnFetch.TabIndex = 6
        Me.btnFetch.Text = "Fetch"
        '
        'txtResults
        '
        Me.txtResults.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.txtResults.Location = New System.Drawing.Point(8, 64)
        Me.txtResults.Multiline = True
        Me.txtResults.Name = "txtResults"
        Me.txtResults.ScrollBars = System.Windows.Forms.ScrollBars.Both
        Me.txtResults.Size = New System.Drawing.Size(400, 216)
        Me.txtResults.TabIndex = 7
        Me.txtResults.Text = ""
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(416, 285)
        Me.Controls.Add(Me.txtResults)
        Me.Controls.Add(Me.btnFetch)
        Me.Controls.Add(Me.txtURI)
        Me.Controls.Add(Me.Label2)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFetch.Click
        Me.Cursor = Cursors.WaitCursor
        Application.DoEvents()

        Try
            ' Make a WebClient.
            Dim web_client As WebClient = New WebClient

            ' Get the indicated URI.
            Dim response As Stream = web_client.OpenRead(txtURI.Text)

            ' Read the result.
            Dim stream_reader As New IO.StreamReader(response)
            txtResults.Text = stream_reader.ReadToEnd()

            ' Close the stream reader and its underlying stream.
            stream_reader.Close()
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Read Error", _
                MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End Try

        Me.Cursor = Cursors.Default
    End Sub
End Class
 
Back
Top