@@ -356,53 +356,33 @@ def browse_page(self, browse_times=0, distance=0, interval=0, back_top=True):
356
356
return self .fb_exp .auto_process (3 )
357
357
358
358
359
- # if __name__ == '__main__':
360
- # filename = '../../resource/facebook_account.txt'
361
- # with open(filename, 'r') as line:
362
- # all_readline = line.readlines()
363
- # for date in all_readline:
364
- # str_info = date.split('---')
365
- # user_account = str(str_info[0]).strip()
366
- # user_password = str(str_info[1]).strip()
367
- #
368
- # # 登陆
369
- # fma = FacebookPCActions(account_info={"account": user_account, "password": user_password}, finger_print={"user_agent": ""}, headless=False)
370
- # if not fma.start_chrome():
371
- # print("start chrome failed")
372
- # fma.set_exception_processor(
373
- # FacebookExceptionProcessor(fma.driver, env="pc", account=fma.account, gender=fma.gender))
374
- # # fma.set_exception_processor()
375
- # res, status = fma.login()
376
- # if not res:
377
- # continue
378
- # cookies = fma.get_cookies()
379
- # print(cookies)
380
- # fma.browse_user_center(3)
381
- # time.sleep(100)
382
-
383
-
384
359
if __name__ == '__main__' :
385
- user_account = str (17610069110 )
386
- user_password = str ("sanmang111..fb" ).strip ()
387
-
388
- # 初始化
389
- cookies = [{'domain' : '.facebook.com' , 'httpOnly' : False , 'name' : 'presence' , 'path' : '/' , 'secure' : True , 'value' : 'EDvF3EtimeF1556521496EuserFA21B35381807782A2EstateFDt3F_5b_5dG556521496536CEchFDp_5f1B35381807782F2CC' }, {'domain' : '.facebook.com' , 'expiry' : 1564297494.289986 , 'httpOnly' : True , 'name' : 'fr' , 'path' : '/' , 'secure' : True , 'value' : '14Cgytn5XS9ADvrMS.AWWAmG4Z8RUATBEoDXsVDoRqB1g.BcxqHO.Is.FzG.0.0.BcxqIW.AWVueXRy' }, {'domain' : '.facebook.com' , 'expiry' : 1564297485.612012 , 'httpOnly' : True , 'name' : 'xs' , 'path' : '/' , 'secure' : True , 'value' : '31%3AzbNHAuA7vvOB-Q%3A2%3A1556521482%3A-1%3A-1' }, {'domain' : '.facebook.com' , 'expiry' : 1557126281 , 'httpOnly' : False , 'name' : 'dpr' , 'path' : '/' , 'secure' : True , 'value' : '2' }, {'domain' : '.facebook.com' , 'expiry' : 1619593469.742837 , 'httpOnly' : True , 'name' : 'datr' , 'path' : '/' , 'secure' : True , 'value' : 'zqHGXKNTrxN8ELHDhr2hXAEo' }, {'domain' : '.facebook.com' , 'expiry' : 1564297485.611967 , 'httpOnly' : False , 'name' : 'c_user' , 'path' : '/' , 'secure' : True , 'value' : '100035381807782' }, {'domain' : '.facebook.com' , 'expiry' : 1556611487.566037 , 'httpOnly' : True , 'name' : 'spin' , 'path' : '/' , 'secure' : True , 'value' : 'r.1000651590_b.trunk_t.1556521485_s.1_v.2_' }, {'domain' : '.facebook.com' , 'expiry' : 1557126293 , 'httpOnly' : False , 'name' : 'wd' , 'path' : '/' , 'secure' : True , 'value' : '1200x754' }, {'domain' : '.facebook.com' , 'expiry' : 1619593485.611922 , 'httpOnly' : True , 'name' : 'sb' , 'path' : '/' , 'secure' : True , 'value' : 'zqHGXDSVQ0-0sXJTMh0cHnju' }]
390
-
391
- fma = FacebookPCActions (account_info = {"account" : user_account , "password" : user_password , "cookies" : cookies }, finger_print = {"user_agent" : "" }, headless = False )
392
- if not fma .start_chrome ():
393
- print ("start chrome failed" )
394
- fma .set_exception_processor (
395
- FacebookExceptionProcessor (fma .driver , env = "pc" , account = fma .account , gender = fma .gender ))
396
- # 登陆
397
- res , status = fma .login ()
398
-
399
- # 浏览页面
400
- # fma.browse_home()
401
- # 增加好友
402
- # fma.add_friends(["mac", "xiaomi"], 2)
403
- # 发送状态
404
- fma .post_status ("wo shi yi zhi xiaoxiaoniao 鸟" )
405
- # 用户中心浏览
406
- # fma.browse_user_center()
360
+ filename = '../../resource/facebook_account.txt'
361
+ with open (filename , 'r' ) as line :
362
+ all_readline = line .readlines ()
363
+ for date in all_readline :
364
+ str_info = date .split ('---' )
365
+ user_account = str (str_info [0 ]).strip ()
366
+ user_password = str (str_info [1 ]).strip ()
367
+
368
+ # 初始化
369
+ # cookies=[{'domain': '.facebook.com', 'httpOnly': False, 'name': 'presence', 'path': '/', 'secure': True, 'value': 'EDvF3EtimeF1556521496EuserFA21B35381807782A2EstateFDt3F_5b_5dG556521496536CEchFDp_5f1B35381807782F2CC'}, {'domain': '.facebook.com', 'expiry': 1564297494.289986, 'httpOnly': True, 'name': 'fr', 'path': '/', 'secure': True, 'value': '14Cgytn5XS9ADvrMS.AWWAmG4Z8RUATBEoDXsVDoRqB1g.BcxqHO.Is.FzG.0.0.BcxqIW.AWVueXRy'}, {'domain': '.facebook.com', 'expiry': 1564297485.612012, 'httpOnly': True, 'name': 'xs', 'path': '/', 'secure': True, 'value': '31%3AzbNHAuA7vvOB-Q%3A2%3A1556521482%3A-1%3A-1'}, {'domain': '.facebook.com', 'expiry': 1557126281, 'httpOnly': False, 'name': 'dpr', 'path': '/', 'secure': True, 'value': '2'}, {'domain': '.facebook.com', 'expiry': 1619593469.742837, 'httpOnly': True, 'name': 'datr', 'path': '/', 'secure': True, 'value': 'zqHGXKNTrxN8ELHDhr2hXAEo'}, {'domain': '.facebook.com', 'expiry': 1564297485.611967, 'httpOnly': False, 'name': 'c_user', 'path': '/', 'secure': True, 'value': '100035381807782'}, {'domain': '.facebook.com', 'expiry': 1556611487.566037, 'httpOnly': True, 'name': 'spin', 'path': '/', 'secure': True, 'value': 'r.1000651590_b.trunk_t.1556521485_s.1_v.2_'}, {'domain': '.facebook.com', 'expiry': 1557126293, 'httpOnly': False, 'name': 'wd', 'path': '/', 'secure': True, 'value': '1200x754'}, {'domain': '.facebook.com', 'expiry': 1619593485.611922, 'httpOnly': True, 'name': 'sb', 'path': '/', 'secure': True, 'value': 'zqHGXDSVQ0-0sXJTMh0cHnju'}]
370
+ cookies = {}
371
+ fma = FacebookPCActions (account_info = {"account" : user_account , "password" : user_password , "cookies" : cookies }, finger_print = {"user_agent" : "" }, headless = False )
372
+ if not fma .start_chrome ():
373
+ print ("start chrome failed" )
374
+ fma .set_exception_processor (
375
+ FacebookExceptionProcessor (fma .driver , env = "pc" , account = fma .account , gender = fma .gender ))
376
+ # 登陆
377
+ res , status = fma .login ()
378
+
379
+ # 浏览页面
380
+ # fma.browse_home()
381
+ # 增加好友
382
+ # fma.add_friends(["pig","dog"], 2)
383
+ # 发送状态
384
+ # fma.post_status("wo shi yi zhi xiaoxiaoniao 鸟")
385
+ # 用户中心浏览
386
+ fma .browse_user_center ()
407
387
408
388
0 commit comments