Get all fbid of your friends with Selenium
- Install
Selenium
and geckodriver for Firefox. - Install
BeautifulSoup
- Copy
sample_user_config.json
to a new fileuser_config.json
. - Replace the user and password.
- Run
get_fbid.py
orget_fbid_better.py
. You can see the different in result of 2 files in the Benchmark section.
time python get_fbid.py
real 0m48.206s
user 0m52.522s
sys 0m5.680s
friendlist: 349
time python get_fbid_better.py
real 0m23.611s
user 0m12.344s
sys 0m2.572s
friendlist: 287
Ground truth: 389
You should use the first method because it has a better result, which is more important than time optimization.