c# - How to use webbrowsr control with Httpwebrequest? -
i using webbrowser control , , list of url of profiles search result.
after there way use httpwebrequest data urls?
i wanted use linked in search profile api confusing. tried using httpwebrequest takes me linkedin login page.
i thinking of way signed in linkedin using webbrowser control maybe using information of webbrowser , adding request pretend logged in .
any ideas? please help
the httpwebrequest sent login page, because there isn´t cookie validation. so, you'll can connect using webbrowser control , cookie, put cookie in webrequest
webbrowser.navigate(someurl); ... cookiecontainer cookies = new cookiecontainer(); foreach (string cookie in webbrowser.document.cookie.split(';')) { string name = cookie.split('=')[0]; string value = cookie.substring(name.length + 1); string path = "/"; string domain = "yourdomain.com"; cookies.add(new cookie(name.trim(), value.trim(), path, domain)); } httpwebrequest request = (httpwebrequest)webrequest.create(url); request.cookiecontainer = cookies; ...
Comments
Post a Comment