如何使用C#Windows窗体中的爬网登录到Linkedin [英] How Can I Login To Linkedin Using Crawl In C# Windows Forms

查看:125
本文介绍了如何使用C#Windows窗体中的爬网登录到Linkedin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我熟悉使用C#抓取来搜索Google等搜索引擎的数据。



例如我使用正则表达式,HttpRequest和HttpResponse,这是来自Google的geeting数据的简单示例



 私有 无效 GoogleSearch( string  _keyword)
{
HttpWebRequest httpReq =(HttpWebRequest)WebRequest.Create( http://www.google .com.eg /#q = + _关键字);

HttpWebResponse httpRes =(HttpWebResponse)httpReq.GetResponse();

StreamReader sr = new StreamReader(httpRes.GetResponseStream());

string responseText = sr.ReadToEnd();

Regex mainRegex = new 正则表达式( < li class = + ' ' + g + ' ' + >。*?< / li> );

MatchCollection matchs = mainRegex.Matches(responseText);

foreach (匹配m 匹配)
{
MessageBox.Show(m.Value);
}
}





现在,我需要从Linkedin搜索引擎获取数据,所以我应该模拟在我可以进行搜索之前登录到Linkedin。



所以任何人都可以帮助我并告诉我这样做的机制是什么?



谢谢

解决方案

您需要从LinkedIn获得开发者帐户和秘密密钥。



这是一篇关于从Windows窗体登录的文章:[ ^ ]。



我自己没有这样做,也不知道登录后你会有多少程序化访问权限,但我确信LinkedIn开发者网站上有相关信息:[ ^ ]。

Hello,

I am familiar with extract data from search engines like Google, etc using crawling with C#.

For example i use Regular expression, HttpRequest and HttpResponse and this is a simple example of geeting data from Google

private void GoogleSearch(string _keyword) 
    {
        HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create("http://www.google.com.eg/#q="+_keyword);

        HttpWebResponse httpRes = (HttpWebResponse)httpReq.GetResponse();

        StreamReader sr = new StreamReader(httpRes.GetResponseStream());

        string responseText = sr.ReadToEnd();

        Regex mainRegex = new Regex("<li class=" + '"' + "g" + '"' +">.*?</li>");

        MatchCollection matchs = mainRegex.Matches(responseText);

        foreach (Match m in matchs)
        {
            MessageBox.Show(m.Value);
        }
    }



Now, i need to get data from Linkedin search engine, so i should simulate the login to Linkedin before i can make the search.

so can any one help me and tell me what is the mechanism of doing this ?

Thanks

解决方案

You will need to get a developer account and a "secret" Key from LinkedIn.

Here's an article on logging-in from Windows Forms: [^].

I have not done this myself, and do not know what data you would have programmatic access to once logged-in, but I am sure the information is there on the LinkedIn developer site: [^].


这篇关于如何使用C#Windows窗体中的爬网登录到Linkedin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆