Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6827605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:17:06+00:00 2026-05-26T22:17:06+00:00

I have the following code that I’m trying to retrieve the HTML document. Not

  • 0

I have the following code that I’m trying to retrieve the HTML document. Not sure why it wouldn’t work.

Here’s what I captured from Live HTTP Headers:

request# POST https://taylor.yc.edu/BANPROD/pkgyc_yccsweb.P_Results POST /BANPROD/pkgyc_yccsweb.P_Results

term_code=201130&search_type=A&keyword=&kw_scope=all&kw_opt=all&subj_code=BIO&crse_numb=205&campus=&instructor=&instr_session=*&attr_type=*&mon=on&tue=on&wed=on&thu=on&fri=on&sat=on&sun=on&avail_flag=on

and here’s the code I’m using:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        mWC = New WebClient
        wbParameters = New NameValueCollection
    wbParameters.Add("term_code", "201130")
    wbParameters.Add("search_type", "A")
    wbParameters.Add("keyword", "")
    wbParameters.Add("kw_scope", "all")
    wbParameters.Add("kw_opt", "all")
    wbParameters.Add("subj_code", "BIO")
    wbParameters.Add("crse_numb", "205")
    wbParameters.Add("campus", "*")
    wbParameters.Add("instructor", "*")
    wbParameters.Add("instr_session", "*")
    wbParameters.Add("attr_type", "*")
    wbParameters.Add("mon", "on")
    wbParameters.Add("tue", "on")
    wbParameters.Add("wed", "on")
    wbParameters.Add("thu", "on")
    wbParameters.Add("fri", "on")
    wbParameters.Add("sat", "on")
    wbParameters.Add("sun", "on")
    wbParameters.Add("avail_flag", "on")

    mWC.QueryString = wbParameters
    Try
        mWC.Headers(HttpRequestHeader.UserAgent) = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; Media Center PC 4.0; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
        mWC.Headers(HttpRequestHeader.AcceptEncoding) = "gzip, deflate"
        mWC.Headers(HttpRequestHeader.Accept) = "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-xpsdocument, */*"
        mWC.Headers(HttpRequestHeader.KeepAlive) = False

        Try
            Dim sResult As String = mWC.DownloadString(New Uri("https://taylor.yc.edu/BANPROD/pkgyc_yccsweb.P_Results"))
            MsgBox(sResult)
        Catch ex As Exception
            MsgBox(ex.InnerException.Message)
            Try
                Dim sResult As String = mWC.DownloadString(New Uri("https://taylor.yc.edu/BANPROD/pkgyc_yccsweb.P_Search"))
                MsgBox(sResult)
            Catch ex2 As Exception
                MsgBox(ex.Message)
                Try
                    Dim bytResults() As Byte = mWC.UploadValues(New Uri("https://taylor.yc.edu/BANPROD/pkgyc_yccsweb.P_Results"), wbParameters)

                Catch ex3 As Exception
                    MsgBox("Didn't work " & ex3.Message)
                End Try
            End Try

        End Try

    Catch ex As Exception
        My.Computer.Clipboard.SetText(ex.Message)
        MsgBox(ex.Message)
    End Try

    Try
        Dim wbr As HttpWebRequest = WebRequest.Create("https://taylor.yc.edu/BANPROD/pkgyc_yccsweb.P_Results")
        wbr.KeepAlive = False
        wbr.Timeout = 600000
        wbr.ReadWriteTimeout = 600000
        wbr.Method = "POST"
        wbr.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; Media Center PC 4.0; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
        wbr.CookieContainer = New CookieContainer()
        'wbr.ContentLength = formData.Length

        'Dim requestStream As Stream = wbr.GetRequestStream()
        'MsgBox(requestStream.Read)
        'requestStream.Close()


        MsgBox(wbr.GetResponse().ToString)



    Catch ex As Exception
        MsgBox(ex.Message)
    End Try

Thanks for your help! I’ve never been able to get webclient to work so this would be a nice breakthrough for me!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:17:07+00:00Added an answer on May 26, 2026 at 10:17 pm

    The answer to this question was answered in another question that I asked here.

    Turns out I needed to retain cookies in order to get it to work. And do it quite a bit differently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code that does not work due to a being a value
I have the following code that I apply when the document is ready: $(document).ready(function
I have the following code that collapses/expands an html area on click. By default
I have the following code that makes sure inputs on forms aren't blank, however
I have following code that I'm trying to test using NUnit and Rhino mocks.
I have the following code that I think should work - however, what I
I have the following code that captures my 'Team_ID' Get parameters and I'm trying
I have following code snippet that i use to compile class at the run
I have the following code that shows either a bug or a misunderstanding on
I have the following code that won't compile and although there is a way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.