Web Scrapping using Window Form(Login required)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nierme
    New Member
    • Nov 2019
    • 1

    #1

    Web Scrapping using Window Form(Login required)

    How could I display in a window form the data from a website that require authentication tokens?

    I have the token(called IDENTITY_KEY in Postman) and authorized to access the data. There is also username and password.

    I could input and retrieve data using Postman so i think I have all the data needed to access it.

    How do I give those data to the website using c# window form in order for the website to allow access?

    How can I display those results in the window form?

    Most of the webscrapping tutorial does not involve window form so I am curious on the possibility.

    I am using Visual Studio.
  • SioSio
    Contributor
    • Dec 2019
    • 272

    #2
    Use the webBrowser control to access a web site.
    The following is an example of entering text from a program into a site.
    Sites that enter user IDs and passwords should be able to handle the same.
    Code:
    		this.webBrowser1.Navigate("https://www.yahoo.com/");
    		while (!(WebBrowser1.ReadyState == WebBrowserReadyState.Complete)) {
    			System.Windows.Forms.Application.DoEvents();
    		}
    		WebBrowser1.Document.All.GetElementsByName("p")(0).InnerText = "Input Your Text";

    Comment

    Working...