+ Reply to Thread
Results 1 to 3 of 3

HTTP requests for searching phone number on facebook and return search result to Excel

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    41

    HTTP requests for searching phone number on facebook and return search result to Excel

    Hi all excel guru,
    I have a list of mobile number on column A.
    So far I just copy those number from excel and and paste it on search box on facebook just to check if the number was link to any facebook profile.
    If found then copy the name and profile link from facebook to excel.
    (Assume that the facebook is already log in)

    My Target is:
    By using excel macro perform copy from excel cell - paste to facebook -facebook search -if found then copy the name and facebook profile to Excel.

    What I got on my searching(and did a little bit of modification) is
    Please Login or Register  to view this content.
    I try to modify the script above to fit my need by replacing link from google search to facebook search BUT still no luck yet (So I need all you guys help on this part)

    Please Login or Register  to view this content.
    I knew that it must be something to do in Vb script in regards to HTML code for input search box on facebook.
    Just for additional information about facebook search box HTML code isThe reason I attach HTML code as image is: every time I put in between
    Please Login or Register  to view this content.
    or then Sucuri firewall will block it.

    FB_input_HTML_code.JPG


    Thank you in advance for all you guys help to solve my problem.

    Regards,
    Benny

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: HTTP requests for searching phone number on facebook and return search result to Excel

    I will not give you a solution as I do not have a Facebook account, but I will give you a pointer.
    The question is not clear to me.
    There are two parts to your request: log-in and then searching and fetching data once you are in.
    If you are simply searching info on a FB with out log-in, the code can work, but needs some tweaking.
    The code you have will not work if you trying to log-in to FB.

    Assuming it is the former, you need to find out the tag names for each item you are trying to fetch.
    You first need to adjust the URL. I just did a quick look in to FB page.
    https://www.facebook.com/search/people/?q=searhcitem
    Assuming this is the right page, you can do similar to
    URL ="https://www.facebook.com/search/people/?q=" & Cells(i, 1)
    Where Cells(i, 1) is the value which comes from column A and it is the same value you are trying to search on FB.
    If all goes well, the next step is to map the info you are looking in to your code. For e.g.

    This line shows you the info you are looking in is found on H3 and it is the first item.

    Set objH3 = objResultDiv.getelementsbytagname("H3")(0)

    This line is to get data from a hyper link or HREF. 0 is the first item
    Set link = objH3.getelementsbytagname("a")(0)
    If you not familiar with basic HTML, you will find hard to understand what I am trying to explain.

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: HTTP requests for searching phone number on facebook and return search result to Excel

    Hi All,
    For those who has Facebook please try the following code and let me know if it is working fine.

    List all mobile number on colum A.

    Set reference to the following:
    1. Visual Basic For Applications
    2. Microsoft Excel 15.0 Object Library
    3. OLE Automation
    4. Microsoft Office 15.0 Object Library
    5. Microsoft Forms 2.0 Object Library
    6. Microsoft HTML Object Library
    7. Microsoft Internet Controls
    8. Microsoft Visual Basic for Applications Extensibility 5.3

    I divide the process in 2 parts:
    1. Log in to FB using internet explorer way.
    2. Searching Mobile number on FB and if find any profile link to mobile number list on column A then write the result in column B,C and D.

    Below is the code,
    1. Log in to FB
    Please Login or Register  to view this content.
    for checking internet connection
    Please Login or Register  to view this content.
    2. For searching mobile number on FB
    Please Login or Register  to view this content.
    My Question is How to convert all the code above to the method of using XMLHTTP or HTTPRequest?

    Regards,
    Benny

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Looking for code to search web based on value and return phone number
    By JeremyBoston in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-19-2015, 03:39 PM
  2. [SOLVED] Matching strings within long http GET requests and displaying matches
    By sd24801 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-17-2014, 02:42 PM
  3. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  4. Is it possible to make Excel dial a phone number from my smart phone?
    By D_Step in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-19-2013, 06:11 PM
  5. Exploring HTTP requests, GET, POST, PUT
    By excelenergy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2012, 07:39 PM
  6. use excel info to search website and return web-result to excel
    By jmhan2209 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2012, 11:45 PM
  7. Exceeding Cell Limit with HTTP requests
    By josephrowan in forum Excel General
    Replies: 0
    Last Post: 04-20-2006, 09:30 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1