Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone,
Im new on c# programing. I want to write a program to get user id from facebook global search(try it here https://www.facebook.com/search/users/all). I use webbrowser to login and success on that. But when I try get to next page - facebook use ajax to load it. I found the link here (https://www.facebook.com/ajax/pagelet/generic.php/BrowseScrollingSetPagelet?data=%7B%22view%22%3A%22list%22%2C%22encoded_query%22%3A%22all(users)%22%2C%22encoded_title%22%3A%22WyJQZW9wbGUiXQ%22%2C%22ref%22%3A%22unknown%22%2C%22logger_source%22%3A%22www_main%22%2C%22typeahead_sid%22%3A%22%22%2C%22tl_log%22%3Afalse%2C%22impression_id%22%3A%2284c3806d%22%2C%22filter_ids%22%3A%7B%22100001199551257%22%3A100001199551257%2C%22100000709428309%22%3A100000709428309%2C%22100000824218483%22%3A100000824218483%2C%22100000443045462%22%3A100000443045462%7D%2C%22experience_type%22%3A%22grammar%22%2C%22exclude_ids%22%3A[]%2C%22cursor%22%3A%22AboIuO35aMeEB9QTDVjdZ6rA0t40V-oW5ZBOK6w9mfNONXljZVQYHQKJwY0IXze_9OfzkG2vmPsTvlRDWMPkmkHp7puAS8q9IXO_IpzClHHUVhUNkCPVfzhiNV3qhdupty1IzJTn_rg98o-OLmjIGso5%22%2C%22ads_at_end%22%3Atrue%7D&__user=xxxxxxxxx&__a=1&__dyn=7n8apij35CCzpQ9UoHaHyG85oCiq2W8GAdBGejheCu&__req=18&__rev=1132776[^]). But it return a js file. Webbrowser not allow see as text so I cant use webBrowser1.DocumentText to get it. I have try use HttpWebRequest but it said I not logined..I dont know how to fetch more page in webbrowser when site use ajax with login needed.

Please help me. Thank you!
Posted
Comments
Sergey Alexandrovich Kryukov 23-Feb-14 12:35pm    
Do use HttpWebRequest but log in in the same session...
—SA
Killing Process 23-Feb-14 12:43pm    
Thanks your quick answer. But how to show the content back to webbrowser?
Sergey Alexandrovich Kryukov 23-Feb-14 13:05pm    
Oh, are you sure you need to show anything? You say that you need to get the id. Anyway, I don't know what scenario do you want to have, maybe you need to think on it yourself. WebBrowser is only needed when you want to create a browser application, basically...
—SA
Killing Process 23-Feb-14 13:11pm    
yes, I need it bro. I want select some options for targeting people here https://www.facebook.com/search/users/all. After searching done with a list as I want, I need get all user id from that but it just 12 user. When browser scroll down, it will load more. I need get all of them.
Sergey Alexandrovich Kryukov 23-Feb-14 13:55pm    
Well, I am still unclear about the big picture. If you downloaded some page using HttpWebRequest, well... roughly speaking, you can store it all in temporary file(s) and use it as URL for your browser... something like that.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900