public void StartInBoardProGetData(string args)
        {
            try
            {
                string[] ParameterData_Split = Regex.Split(args, ":");
                string Account = ParameterData_Split[0];
                string password = ParameterData_Split[1];
                string ProxyAddress = ParameterData_Split[2];
                string ProxyPort = ParameterData_Split[3];
                string ProxyUserName = ParameterData_Split[4];
                string ProxyPassword = ParameterData_Split[5];
                string FirstName = ParameterData_Split[7];
                string LastName = ParameterData_Split[8];
                string Location = ParameterData_Split[9];
                string Country = ParameterData_Split[10];
                string LocationArea = ParameterData_Split[11];
                string PostalCode = ParameterData_Split[12];
                string Company = ParameterData_Split[13];
                string Keyword = ParameterData_Split[14];
                string Title = ParameterData_Split[15];
                string IndustryType = ParameterData_Split[16];
                string Relationship = ParameterData_Split[17];
                string language = ParameterData_Split[18];
                string Groups = ParameterData_Split[19];
                string FileName = ParameterData_Split[20];
                string TitleValue = ParameterData_Split[21];
                string CompanyValue = ParameterData_Split[22];
                string within = ParameterData_Split[23];
                string YearsOfExperience = ParameterData_Split[24];
                string Function = ParameterData_Split[25];
                string SeniorLevel = ParameterData_Split[26];
                string IntrestedIn = ParameterData_Split[27];
                string CompanySize = ParameterData_Split[28];
                string Fortune1000 = ParameterData_Split[29];
                string RecentlyJoined = ParameterData_Split[30];

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedInScrape objlinkscr = new LinkedInScrape();
                LinkedInMaster objLinkedInMaster = new LinkedInMaster();

                AddToLogger("[ " + DateTime.Now + " ] => [ Logging with Account :  " + Account + " ]");
                objLinkedInMaster.LoginHttpHelperForCampaignScraper(ref HttpHelper, Account, password, ProxyAddress, ProxyPort, ProxyUserName, ProxyPassword);

                if (objLinkedInMaster.IsLoggedIn)
                {
                    AddToLogger("[ " + DateTime.Now + " ] => [ Logged in  with Account :  " + Account + " ]");
                    AddToLogger("[ " + DateTime.Now + " ] => [ Start LinkedIn Crawling ]");
                    StartCampaignInBoardProGetDataWithPagination(ref HttpHelper, Account, FirstName, LastName, Location, Country, LocationArea, PostalCode, Company, Keyword, Title, IndustryType, Relationship, language, Groups, FileName, TitleValue, CompanyValue, within, YearsOfExperience, Function, SeniorLevel, IntrestedIn, CompanySize, Fortune1000, RecentlyJoined);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error >>> " + ex.StackTrace);
            }
            finally
            {

            }
        }
Example #2
0
        public void StartInBoardProGetData()
        {
            try
            {
                if (IsStop_InBoardProGetDataThread)
                {
                    return;
                }

                lstInBoardProGetDataThraed.Add(Thread.CurrentThread);
                lstInBoardProGetDataThraed = lstInBoardProGetDataThraed.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;

                HttpHelper = new GlobusHttpHelper();
                LinkedInScrape objlinkscr = new LinkedInScrape();
                bool isLoggedIn = Login_InBoardProGetData();

                if (isLoggedIn)
                {
                    AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Start LinkedIn Crawling ]");
                    objlinkscr.StartInBoardProGetDataWithPagination(ref HttpHelper);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error >>> " + ex.StackTrace);
            }
            finally
            {
                try
                {
                    DisableEnableScrapperControls();

                    this.Invoke(new MethodInvoker(delegate
                    {
                        btnStopScraper.Enabled = true;
                        btnSearchScraper.Enabled = true;
                        btnSearchScraper.Cursor = Cursors.Default;
                    }));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
            }
        }
Example #3
0
        public void StartInBoardProGetData(string args)
        {
            try
            {
                if (IsStop_InBoardProGetDataThread)
                {
                    return;
                }

                string[] ParameterData_Split = Regex.Split(args, ":");
                string Account = ParameterData_Split[0];
                string password = ParameterData_Split[1];
                string ProxyAddress = ParameterData_Split[2];
                string ProxyPort = ParameterData_Split[3];
                string ProxyUserName = ParameterData_Split[4];
                string ProxyPassword = ParameterData_Split[5];
                string FirstName = ParameterData_Split[7];
                string LastName = ParameterData_Split[8];
                string Location = ParameterData_Split[9];
                string Country = ParameterData_Split[10];
                string LocationArea = ParameterData_Split[11];
                string PostalCode = ParameterData_Split[12];
                string Company = ParameterData_Split[13];
                string Keyword = ParameterData_Split[14];
                string Title = ParameterData_Split[15];
                string IndustryType = ParameterData_Split[16];
                string Relationship = ParameterData_Split[17];
                string language = ParameterData_Split[18];
                string Groups = ParameterData_Split[19];
                string FileName = ParameterData_Split[20];
                string TitleValue = ParameterData_Split[21];
                string CompanyValue = ParameterData_Split[22];
                string within = ParameterData_Split[23];
                string YearsOfExperience = ParameterData_Split[24];
                string Function = ParameterData_Split[25];
                string SeniorLevel = ParameterData_Split[26];
                string IntrestedIn = ParameterData_Split[27];
                string CompanySize = ParameterData_Split[28];
                string Fortune1000 = ParameterData_Split[29];
                string RecentlyJoined = ParameterData_Split[30];

                lstInBoardProGetDataThraed.Add(Thread.CurrentThread);
                lstInBoardProGetDataThraed = lstInBoardProGetDataThraed.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedInScrape objlinkscr = new LinkedInScrape();
                bool isLoggedIn = Login_InBoardProGetDataForCampaignScraper(ref HttpHelper, Account, password, ProxyAddress, ProxyPort, ProxyUserName, ProxyPassword);

                if (isLoggedIn)
                {
                    AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Start LinkedIn Crawling ]");
                    objlinkscr.StartCampaignInBoardProGetDataWithPagination(ref HttpHelper, Account, FirstName, LastName, Location, Country, LocationArea, PostalCode, Company, Keyword, Title, IndustryType, Relationship, language, Groups, FileName, TitleValue, CompanyValue, within, YearsOfExperience, Function, SeniorLevel, IntrestedIn, CompanySize, Fortune1000, RecentlyJoined);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error >>> " + ex.StackTrace);
            }
            finally
            {
                try
                {
                    DisableEnableScrapperControls();

                    this.Invoke(new MethodInvoker(delegate
                    {
                        btnStopScraper.Enabled = true;
                        btnSearchScraper.Enabled = true;
                        btnSearchScraper.Cursor = Cursors.Default;
                    }));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
            }
        }
Example #4
0
        private void GetEmployeeDataFromCompanyURL(ref GlobusHttpHelper HttpHelper, List<string> lstCompanyUrls)
        {
            try
            {
                foreach (string item in lstCompanyUrls)
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Starting Parsing With UserName : "******" ]");
                        //Log("Url >>> " + item);
                        string compCode = Regex.Split(item, "company/")[1];
                        compCode = compCode.Split('?')[0];
                        string EmployeeUrl = "https://www.linkedin.com/vsearch/p?keywords=" + SearchCriteria.Keyword + "&openAdvancedForm=true&locationType=" + SearchCriteria.Country + "&countryCode=" + SearchCriteria.Country + "&f_CC=" + compCode + "&rsid=&orig=ADVS";

                        string LinkPagesourceCompEmp = HttpHelper.getHtmlfromUrl1(new Uri(EmployeeUrl));

                        try
                        {
                            //string EmployeeUrl = string.Empty;

                            #region commented old code
                            //string[] URL_Split = Regex.Split(LinkPagesource, "<li><a class=\"density\" ");
                            //foreach (string CompanyURl in URL_Split)
                            //{
                            //    try
                            //    {
                            //        if (CompanyURl.Contains("extra_biz_employees_deg_connected"))
                            //        {
                            //            int startIndex = CompanyURl.IndexOf("href=\"");
                            //            string start = CompanyURl.Substring(startIndex).Replace("href=\"", string.Empty);
                            //            int endIndex = start.IndexOf("\">");
                            //            string end = start.Substring(0, endIndex).Replace("\">", string.Empty).Trim();
                            //            EmployeeUrl = "https://www.linkedin.com" + end;
                            //        }
                            //    }
                            //    catch
                            //    { }
                            //}
                            #endregion

                            int pagenumber = 0;
                            string strPageNumber = string.Empty;
                            string[] Arr12 = Regex.Split(LinkPagesourceCompEmp, "<p class=\"summary\">");

                            if (Arr12.Count() == 1)
                            {
                                Arr12 = Regex.Split(LinkPagesourceCompEmp, "formattedResultCount");
                            }

                            foreach (string item1 in Arr12)
                            {
                                try
                                {
                                    if (!item1.Contains("<!DOCTYPE"))
                                    {
                                        if (item1.Contains("<strong>"))
                                        {
                                            try
                                            {
                                                //":"15,439","i18n_survey_feedback_thanks":
                                                string pageNO = Regex.Split(item1, "i18n_survey")[0].Replace(":", string.Empty).Replace(",", string.Empty).Replace("\"", string.Empty);

                                                string[] arrPageNO = Regex.Split(pageNO, "[^0-9]");

                                                foreach (string item2 in arrPageNO)
                                                {
                                                    try
                                                    {
                                                        if (!string.IsNullOrEmpty(item2))
                                                        {
                                                            strPageNumber = item2;
                                                        }
                                                    }
                                                    catch
                                                    {
                                                    }
                                                }
                                            }
                                            catch
                                            {
                                            }
                                        }
                                    }
                                }
                                catch
                                {
                                }
                            }

                            try
                            {
                                strPageNumber = strPageNumber.Replace(".", string.Empty);
                                if (strPageNumber != string.Empty || strPageNumber == "0")
                                {
                                    Log("[ " + DateTime.Now + " ] => [ Total Results found: " + strPageNumber + " ]");
                                }
                                pagenumber = int.Parse(strPageNumber);
                            }
                            catch (Exception)
                            {

                            }

                            pagenumber = (pagenumber / 10) + 1;

                            LinkedInScrape obj_LinkedInScrape = new LinkedInScrape();

                            EmployeeUrl = EmployeeUrl + "##CompanyEmployeeScraper";

                            obj_LinkedInScrape.StartCompanyEmployeeScraperWithPagination(ref HttpHelper, EmployeeUrl, pagenumber);

                        }
                        catch
                        { }
                    }
                    catch
                    { }
                }
            }
            catch { }
        }