Results 1 to 10 of 10

Thread: split option value in html page

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    12

    split option value in html page

    how to split the option values in html page in vb.net

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: split option value in html page

    What do you mean by 'split' in this context? Could you use more words to explain your question?

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    12

    Re: split option value in html page

    sure..

    actually im using the following source code
    <OPTION VALUE="ACCT">Accounting
    <OPTION VALUE="AJ">Administration of Justice
    <OPTION VALUE="AGRI">Agriculture/Landscaping
    <OPTION VALUE="ACRV">Air Cond/Refrig/Vent
    <OPTION VALUE="AFAB">Aircraft Fabrication&Assembly
    <OPTION VALUE="AERO">Airframe and Powerplant
    <OPTION VALUE="ANTH">Anthropology
    <OPTION VALUE="ART">Art
    <OPTION VALUE="ASTR">Astronomy
    <OPTION VALUE="ATH">Athletic Training
    <OPTION VALUE="AUTO">Automotive Technology
    <OPTION VALUE="BIOL">Biology
    <OPTION VALUE="BUS">Business
    <OPTION VALUE="CHEM">Chemistry
    <OPTION VALUE="CFE">Child and Family Education
    <OPTION VALUE="CT">Clothing and Textiles
    <OPTION VALUE="COMM">Communication Arts
    <OPTION VALUE="CA">Computer Applications
    <OPTION VALUE="CG">Computer Graphics
    <OPTION VALUE="CIS">Computer Information Science
    <OPTION VALUE="DA">Dance
    <OPTION VALUE="DFST">Deaf Studies
    <OPTION VALUE="ECON">Economics
    <OPTION VALUE="ED">Education
    <OPTION VALUE="ELEC">Electrical Technology
    <OPTION VALUE="ELTE">Electronics Technology
    <OPTION VALUE="EMT">Emergency Medical Technology
    <OPTION VALUE="ENGR">Engineering
    <OPTION VALUE="ENGL">English
    <OPTION VALUE="ESL">English as a Second Language
    <OPTION VALUE="EOPS">Extended Opportunity Program
    <OPTION VALUE="FTV">Film and Television
    <OPTION VALUE="FTEC">Fire Technology
    <OPTION VALUE="FREN">French
    <OPTION VALUE="GEOG">Geography
    <OPTION VALUE="GER">German
    <OPTION VALUE="HE">Health Education
    <OPTION VALUE="GED">High School Equivalency
    <OPTION VALUE="HIST">History
    <OPTION VALUE="HHA">Home Health Aide
    <OPTION VALUE="HD">Human Development
    <OPTION VALUE="ID">Interior Design
    <OPTION VALUE="INT">Interpreter Training
    <OPTION VALUE="LAC">Learning Assistance Center
    <OPTION VALUE="LIB">Library
    <OPTION VALUE="MGT">Management
    <OPTION VALUE="MATH">Mathematics
    <OPTION VALUE="MOA">Medical Office Assisting
    <OPTION VALUE="MM">Multimedia
    <OPTION VALUE="MUS">Music
    <OPTION VALUE="NCR">Non-Credit Program
    <OPTION VALUE="NA">Nurse Aide
    <OPTION VALUE="NS">Nursing Science
    <OPTION VALUE="NF">Nutrition and Foods
    <OPTION VALUE="OT">Office Technology
    <OPTION VALUE="PHIL">Philosophy
    <OPTION VALUE="PHOT">Photography
    <OPTION VALUE="PE">Physical Education
    <OPTION VALUE="PSCI">Physical Science
    <OPTION VALUE="PHYS">Physics
    <OPTION VALUE="POLS">Political Science
    <OPTION VALUE="PSY">Psychology
    <OPTION VALUE="READ">Reading
    <OPTION VALUE="RE">Real Estate
    <OPTION VALUE="RT">Respiratory Care/Therapy
    <OPTION VALUE="SOC">Sociology
    <OPTION VALUE="SPAN">Spanish
    <OPTION VALUE="THA">Theatre Arts
    <OPTION VALUE="VN">Vocational Nursing
    <OPTION VALUE="WELD">Welding
    <OPTION VALUE="WFDV">Work Force Development
    </SELECT>
    in this code i want to split the values like Accounting,Administration of Justice..
    all subjects during runtime and store it in a combobox

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: split option value in html page

    It's already in a combobox format (a select box). What am I missing here?

    All you're missing is the </option> at the end of each line.

    Is this "source code" you showed me not in your web page?

    Also, PM RobDog888 and ask him to move this thread to the ASP.NET forum. He's a good mover and shaker.

  5. #5
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: split option value in html page

    If this is an html source code of a web page and you want to extract information from it, Regex is a good candidate.

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    12

    Re: split option value in html page

    yes i want to split this names only and stored to a combobox in my form pls send me vb.net code for such process.website for that html code is
    {https://bannerweb.avc.edu/avcprod/az_tw_zipsched.P_search}

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: split option value in html page

    Use an HttpWebRequest. Request the page, get the string back.

    Using regular expressions, look for the bit where it says

    <SELECT NAME="sel_subj"

    Because sel_subj identifies that <select> uniquely.

    Get all the text between that select and the closing </select>.

    Now you can use regular expressions again to get the text after each of the <option>s, or you can replace each <OPTION with </OPTION><OPTION so that it's valid enough to be loaded into an XMLNode or some XML manipulating class.

  8. #8

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    12

    Re: split option value in html page

    thank u so much
    i need another help pls visit that site and click the department u can see that the datas in the department.first store that page in local drive and i want to save the department datas in a text document during runtime pls help me with sample code.

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: split option value in html page

    Same as before. Just find your 'unique' markers to start the string parsing.

  10. #10

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    12

    Re: split option value in html page

    thank u so much
    i need another help pls visit that site and click the department u can see that the datas in the department.first store that page in local drive and i want to save the department datas in a text document during runtime pls help me with sample code.im not understand it will u pls send me one sample code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width