Results 1 to 4 of 4

Thread: Webbrowser Control Finding Elements

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Webbrowser Control Finding Elements

    Hi,

    I have this requirement. In our system we have a list of contacts, and for each of these contacts we have saved their linkedIn Profile links. Now everytime a contact changes their Company position and email we should be able to update our database without manual intervention.

    This is how I designed the solution.

    1. I have a windows app that runs every morning that will pull all of the data in linked in via the webbrowser control and save the results in an xml.

    2. I have a batch scheduled job in salesforce that will call my webservice that will transform the xml to json format.


    Problem: I can successfully navigate to my contacts profile in linked in via the web browser control but I can't seem to find the div containing the information that I need.

    I tried using
    Code:
                        var result = "";
                        
                        foreach (HtmlElement el in wb.Document.GetElementsByTagName("div"))
                            if (el.GetAttribute("class").Contains("ember-view"))
                            {
                                result = el.InnerText;
                            }
                            else
                            {
                                result = el.InnerHtml;
                            }
    but it does not get all the divs. Any help would be appreciated

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: Webbrowser Control Finding Elements

    It would help if you could post the HTML that you're trying to parse.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Re: Webbrowser Control Finding Elements

    Quote Originally Posted by jmcilhinney View Post
    It would help if you could post the HTML that you're trying to parse.
    Hi,

    Sorry for the late reply. I was stuck somewhere without internet. By the way this is the link.
    https://drive.google.com/file/d/0B6h...ew?usp=sharing

    I need to get all data from this area.

    Name:  Capture.jpg
Views: 92
Size:  12.8 KB

  4. #4
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: Webbrowser Control Finding Elements

    I don't know if the profile page can be crawled by bot scripts or webbrowser control. If you check the page source, the keywords Contact and Personal Info, Email, Connected and others do not exist.

    - kgc
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width