开发者

VB 2008 - Extracting data from website question

Having more problems coming up with some code for my hwk. All I've been able to do is create the form. We have to get information off of a website and load certain information back into the textboxes on our form. I need a push in the right direction if someone could help.

Assignment 6 – Text Parsing

Many applications require you to extract information from a block of text. We will be using this heavily in the project. This project is designed to give you some practice extracting information out of text files. You will need to open up a file, search the file for some specific content, and then copy that content and place it on screen.

Go to Jobs.com and select a state that starts with the same letter as your last name (if there is no state that starts with the same letter, use the second letter, then the third letter, etc.). For example if my name was ‘John Byway’, since there was no B or Y, I would pick a state starting with W – either Washington, West Virginia, Wisconsin, or Wyoming.

The idea is you want to extract all the jobs info开发者_如何转开发rmation out of the page. We want to put the jobs names in a combo box, so the use can pick any of the jobs. Ideally, this would also show the information about each job. You don’t need to do that. However, you do need to extract the information and put it on the screen (When you load the next job, the old job information will be lost, and you will be left with the information about the last job loaded)

Tasks 1. Go to the above address, view the source in the browser, copy and paste it into a text file. You do not need to access the Source of the web page within your application.(in IE go to View / Source; In FireFox go to View / Page Source) 3. Extract each job title and place the name in the Combo box. 4. Find and extract the following fields. Note, some jobs may not list all of these. In that case, get as many as are presented.

a. Date b. Title of job c. Company d. Location e. Description of job f. URL associated with the “More” for each description g. Experience level h. Career level i. Education level

  1. Indicate on screen how many jobs you found. Note, you only need to look on the first page of jobs


RegEx is a great way to do the kind of text parsing you need. Here are a couple of links:

VB Dot Net Heaven Intro to RegEx

Discussion about parsing HTML with VB.Net

Note: A well-defined RegEx pattern will get the heavy lifting done for you in this assignment in a dozen lines of code.

P.S. For future reference and perhaps for now... cut the nonsense out of your question. That whole bit about choosing a state with a letter from your name is ridiculous. Please take it out. It's just confusing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜