我试图在搜索中抓取由ajax(页面滚动)加载的Facebook帖子。 我使用Grab并请求这个。
使用Grab授权正在工作,然后我尝试模拟滚动请求,由浏览器生成并通过post发送以加载下一堆结果。 响应html中的错误是:"抱歉,您的请求无法加载"
这是代码(大代码因为巨大的facebook请求)。
import requests
# from bs4 import BeautifulSoup
class FacebookScraper(object):
def __init__(self):
self.data = {
"view":"list",
"encoded_query":"{\"bqf\":\"keywords_top(\\u0025D0\\u0025BB\\u0025D0\\u0025B0\\u0025D0\\u0025B2\\u0025D0\\u0025B0\\u0025D0\\u0025BB\\u0025D1\\u00258C+\\u0025D0\\u0025BF\\u0025D0\\u0025BE\\u0025D1\\u002582\\u0025D0\\u0025BE\\u0025D0\\u0025BA)\",\"vertical\":\"content\",\"post_search_vertical\":None,\"intent_data\":\"{\\\"intent\\\":\\\"posts\\\",\\\"entity_id\\\":None,\\\"sub_intents\\\":{\\\"user\\\":True},\\\"user_confidence\\\":0.2384902536869,\\\"typeahead_user_confidence\\\":0.69785696268082,\\\"quel_topics\\\":[],\\\"multi_label_intents\\\":[{\\\"value\\\":True,\\\"confidence\\\":0.0113326292485},{\\\"value\\\":True,\\\"confidence\\\":6.7988303271704e-6},{\\\"value\\\":True,\\\"confidence\\\":0.0008767499239184},{\\\"value\\\":True,\\\"confidence\\\":0.025693353265524},{\\\"value\\\":True,\\\"confidence\\\":0.010204718448222},{\\\"value\\\":True,\\\"confidence\\\":0.0020656401757151},{\\\"value\\\":True,\\\"confidence\\\":0.01333892159164},{\\\"value\\\":True,\\\"confidence\\\":0.0087564773857594},{\\\"value\\\":True,\\\"confidence\\\":0.0016323747113347},{\\\"value\\\":True,\\\"confidence\\\":0.0084763253107667},{\\\"value\\\":True,\\\"confidence\\\":0.015831520780921},{\\\"value\\\":True,\\\"confidence\\\":0.004807879216969},{\\\"value\\\":True,\\\"confidence\\\":0.058732055127621},{\\\"value\\\":True,\\\"confidence\\\":0.033020552247763},{\\\"value\\\":True,\\\"confidence\\\":0.0066938307136297},{\\\"value\\\":True,\\\"confidence\\\":0.0071515664458275},{\\\"value\\\":True,\\\"confidence\\\":0.57516884803772},{\\\"value\\\":True,\\\"confidence\\\":0.21925939619541},{\\\"value\\\":True,\\\"confidence\\\":0.0026327867526561},{\\\"value\\\":True,\\\"confidence\\\":0.0046313949860632},{\\\"value\\\":True,\\\"confidence\\\":0.0015605170046911}],\\\"annotated_string\\\":\\\"{\\\\\\\"entities\\\\\\\":[],\\\\\\\"segments\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"\\\\\\\\u003Cusername>\\\\\\\",\\\\\\\"tokens\\\\\\\":\\\\\\\"\\\\\\\\u043b\\\\\\\\u0430\\\\\\\\u0432\\\\\\\\u0430\\\\\\\\u043b\\\\\\\\u044c \\\\\\\\u043f\\\\\\\\u043e\\\\\\\\u0442\\\\\\\\u043e\\\\\\\\u043a\\\\\\\"}]}\\\"}\",\"filters\":[],\"has_chrono_sort\":False,\"query_analysis\":\"260012326cdb01810a4e4557535f4556454e54021b028103646576020470726f6402002c00121b0c67d21a3fe05e176c77a66cda1a0000000000000000dc1a0000000000000000de1a0000000000000000e41a0000000000000000e61a0000000000000000d22f0000000000000000d42f0000000000000000e2443ff0000000000000e4440000000000000000e6444000000000000000e8444000000000000000150217bfb09501ce920b25173fe654d82000000012121211173fce86d94000000022273fe654d8200000001b002c1817d0bbd0b0d0b2d0b0d0bbd18c20d0bfd0bed182d0bed0ba092c2c180cd0bbd0b0d0b2d0b0d0bbd18c3500150c00180ad0bfd0bed182d0bed0ba350e151800190c190c190c190c2b0f8b27636f6d6d657263652d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c1811173fddf904c00000000023656e742d696e74656e742f6e6c705f746f6f6c732f6372662f76322f64656661756c74025c0411173fec1f5e868bd3ba001011173fbf050bcba16232002b666f726569676e2d6c616e672d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c2411173fef39b7400000000024686f77746f2d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c2a11173fd02c2f2000000000276c6f636174696f6e2d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c1c11173fc1dafa6000000000246d656469612d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c1a11173fdd5f7d40000000002a6d656469612d766964656f2d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c2e11173fc1ae7780000000002a6d756c74692d6c6162656c2d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74155c0c11173f87358fc0000000001811173fae1220c0000000001a11173f9a4f5bc0000000001c11173fa0e811e0000000001e11173f81eeea80000000002211173f7d4af600000000002411173fe267c880000000002611173fcc10b120000000002e11173f84e63620000000003211173edc843040000000003411173f4cbab620000000003611173f60ebf620000000003811173f8b516fc0000000003a11173f5abead00000000003c11173f815c0920000000003e11173f90362360000000004011173f73b16d40000000004211173f7b6afd80000000004411173f65915aa0000000004611173f72f85ea0000000004811173f5991486000000000256e6565646c652d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74045c0c11173fc8bfb760000000000e11173f656d9940000000001211173fcab97360000000001411173fe30c47a0000000002d6e6f742d756e6465727374616e642d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c2611173fef3cb5a000000000286f6666656e736976652d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c2211173fced77fc0000000002a706f73742d7365617263682d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74025c0c11173fce86d940000000002c11173fe85e49a000000000257265636970652d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c1e11173fb477c06000000000257265766965772d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74015c2811173fc2cc7f6000000000227365676d656e7465722f6e6c705f746f6f6c732f6372662f76312f64656661756c74035c0411173fe7790ccebcc349000e11173f97cfe47392db00001011173fcf21d0369a9779001b018b2a6d756c74692d6c6162656c2d696e74656e742f6e6c705f746f6f6c732f6e6e2f76312f64656661756c74155c0011173f87358fc0000000000211173edc843040000000000411173f4cbab620000000000611173f9a4f5bc0000000000811173f84e63620000000000a11173f60ebf620000000000c11173f8b516fc0000000000e11173f81eeea80000000001011173f5abead00000000001211173f815c0920000000001411173f90362360000000001611173f73b16d40000000001811173fae1220c0000000001a11173fa0e811e0000000001c11173f7b6afd80000000001e11173f7d4af600000000002011173fe267c880000000002211173fcc10b120000000002411173f65915aa0000000002611173f72f85ea0000000002811173f5991486000000000191c3c00170000000000000000280000191c1c1500150200180a3c757365726e616d653e27c023bb4d4ccccccd0019173fc2b6d1f6c95fb7191c1817d0bbd0b0d0b2d0b0d0bbd18c20d0bfd0bed182d0bed0ba173ff0000000000000192c180cd0bbd0b0d0b2d0b0d0bbd18c00180ad0bfd0bed182d0bed0ba00001c19f7ac0200000000000000003fcc40836000000000000000000000003fc8a732200000003fe0d109e00000003fe5f09ac00000003ff642642000000000000000000000003fa2a7a4800000003fe5527a80000000000000000000000000000000000000003fe4edc7c000000000000000000000003fb63cd3400000003fc87f2a600000003ffa64124000000000000000000000003ff0d88e800000003ff40616e000000000000000000000003fe5be67c000000000000000000000000000000000000000000000000000000000000000000000003fc48a9d200000003ff6aac4e00000003fe61fcda000000000000000000000003ffc14bda00000003ff93337c00000003fe0591e4000000000000000000000003fe43bff8000000000000000000000003fcb6722c00000003ff3a382000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003feb1ec9c000000000000000000000000000000000000000000000000000000000000000000000003fdd9060400000003feab43b600000003fb34253a00000003fea54e4c000000000000000000000000000000000000000000000000000000000000000000000003f6284f80000000000000000000000003feea20b400000003fbec16d40000000000000000000000000000000000000003ff56283000000000000000000000000000000000000000000000000000000003ffcaca2200000003fcb58b7c00000003fe20d4a8000000000000000000000003fbeb9d9000000003ffa88d6a00000003fe07126e000000000000000000000003ff1c8bb000000003fcdd054e00000000000000000000000000000000000000000000000000000003fe3ee79e00000003fe6a6bb80000000000000000000000000000000000000003fb99557400000003fe6088c4000000000000000000000003fec4cef000000003ff0d93b200000003fab168c800000003fd07039c000000000000000000000003ff898ebc00000003fd94c884000000000000000000000003fca4770200000003fd1cefd200000003fd01a0d000000003fd1b3aac000000000000000000000003fe7cbecc00000003ff0e3ec000000003fd17e1f80000000000000000000000000000000000000003fac19c9e000000000000000000000003fa4378e400000003fe34b7aa00000003ff0026a8000000000000000000000003fc2aa3bc00000003fe16d50c00000003fe9dd2ce00000000000000000000000400465c2a00000003ff166be600000003fdd872060000000000000000000000000000000000000003ff6c303200000003fbc1ee3200000003fed3cbf600000003fd23122e000000000000000000000003ff0d19a800000003fee6438200000003fe2078f000000003fa28aa72000000000000000000000003fd7a51780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fe7f01f8000000000000000000000003fcc803a000000003ff6a8224000000000000000000000003fedab2740000000000000000000000000000000000000003fddf93d000000003fda10f1400000003feef9dce00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fc47171200000003fdd9f494000000000000000000000003ff829c7a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ff0ac2aa00000003fee73510000000000000000000000003ff3a77ba00000003fef219e600000003fd645654000000000000000000000000000000000000000000000000000000000000000000000003fe6efbe2000000040021fd4c0000000000000000000000000000000000000003ff2f61b00000000000000000000000040015234e00000003ff04f420000000000000000000000000000000000000000000000000000000000000000000000003fd7a8ed8000000000000000000000003fcde3f000000000000000000000000000000000000000003fe8454f600000003fe5aef0400000003fd95599000000003fe31213c000000000000000000000003fe95bb6000000003fe108bb200000003fd947f74000000000000000000000003fbd4c526000000000000000000000003fe5dea7a00000003fe659bf20000000000000000000000000000000000000003ff00fe3e00000003fd7917c0000000000000000000000003fe6a8c70000000000000000000000000000000000000000000000000000000000000000000000003ff20a87800000003fe3b0a9a000000040004fdbc000000000000000000000000000000000000000000000000000000000000000000000003ff0c4f9a00000003fba5561e00000003ff5c285200000003fe8092be0000000000000000000000000000000000000003fd7887400000000000000000000000000000000000000003fe52b78a000000000000000000000003fe2f4f9a00000003fe970e4c00000003fa5994fc00000003ff6fbfb600000003ff455c680000000000000000000000000000000000000003fe33f52a00000000000000000000000000000000000000000000000000000003ff1e724e000000000000000000000003fdf9d8280000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ff8dd5f00000000000000000000000000000000000000003fee65ec400000003fec530a400000003fbe6991400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fc2d6072000000000000000000000003fa1a780e000000000000000000000000000000000000000000000000000000000000000000000003fe53b5a4000000000000000000000003ff29b4b600000003fc323c4800000003fe817a8800000003fe6481e80000000000000000000000000000000000000000000000000000000000000000000000000000000000000003feaa05120000000400150ef00000000000000000000000000000000000000003fe3f21e4000000040031c0dc0000000000000000000000000000000000000003feb6485e00000003fe41e8a2000000000000000000000003fdddaea800000003fc7c6cee00000003fd24ac9e00000000000000000000000000b0e038c12544f4b454e2f434349462f44454641554c54192c1c1500151800191c380cd0bbd0b0d0b2d0b0d0bbd18c00001c151a151400191c380ad0bfd0bed182d0bed0ba00001b00001e746f6b656e2f676f6c645f7374616e646172642f76312f64656661756c74192c1c1500150c00191c380cd0bbd0b0d0b2d0b0d0bbd18c00001c150e150a00191c380ad0bfd0bed182d0bed0ba00001b018c1b7365676d656e742f626f756e646172792f76312f64656661756c74292c291c173fc2b6d1f6c95fb70000291c173ff00000000000000000000020746f6b656e2f6931386e2f72756c652d62617365642f76312f64656661756c74192c1c1500150c00191c380cd0bbd0b0d0b2d0b0d0bbd18c00001c150e150a00191c380ad0bfd0bed182d0bed0ba00001b00001b0e89185155454c2f4e4c505f534552564943452f44454641554c541c290c0023656e742d696e74656e742f6e6c705f746f6f6c732f6372662f76322f64656661756c741c290c292c173fbf050bcba1623215061806656e7469747900173fec1f5e868bd3ba15041804706f73740000217061747465726e5f7061727365722f7461676765722f416972706f7274436f64651c290c001a7061747465726e5f7061727365722f7461676765722f436974791c290c001e7061747465726e5f7061727365722f7461676765722f43757272656e63791c290c001a7061747465726e5f7061727365722f7461676765722f446174651c290c00217061747465726e5f7061727365722f7461676765722f47656f4c6f636174696f6e1c290c00217061747465726e5f7061727365722f7461676765722f47726f757073546f7069631c290c001d7061747465726e5f7061727365722f7461676765722f486f6c696461791c290c001e7061747465726e5f7061727365722f7461676765722f4c616e67756167651c290c001c7061747465726e5f7061727365722f7461676765722f4e756d6265721c290c00237061747465726e5f7061727365722f7461676765722f506c61636543617465676f72791c290c002571756572792d7365676d656e7465722f6e6c705f746f6f6c732f6372662f64656661756c741c291c1c1500150400191c250018036b77642b0147b49201c023bb4d4ccccccd000017c01996af93180d2600227365676d656e7465722f6e6c705f746f6f6c732f6372662f76312f64656661756c741c290c293c173fcf21d0369a977915061806656e7469747900173fe7790ccebcc34915041804706f737400173f97cfe47392db00150218076772616d6d61720000001b015c028b1d5c0411173fe7790ccebcc349000c11173fce86d940000000000e11173f97cfe47392db00001011173fbf050bcba16232001211173fcab97360000000001411173fe30c47a0000000001811173fddf904c0000000001a11173fdd5f7d40000000001c11173fc1dafa60000000001e11173fb477c060000000002211173fced77fc0000000002411173fef39b740000000002611173fef3cb5a0000000002811173fc2cc7f60000000002a11173fd02c2f20000000002c11173fe85e49a0000000002e11173fc1ae7780000000003211173edc843040000000003411173f4cbab620000000003611173f60ebf620000000003811173f8b516fc0000000003a11173f5abead00000000003c11173f815c0920000000003e11173f90362360000000004011173f73b16d40000000004211173f7b6afd80000000004411173f65915aa0000000004611173f72f85ea0000000004811173f59914860000000002b155c0011173f87358fc0000000000211173edc843040000000000411173f4cbab620000000000611173f9a4f5bc0000000000811173f84e63620000000000a11173f60ebf620000000000c11173f8b516fc0000000000e11173f81eeea80000000001011173f5abead00000000001211173f815c0920000000001411173f90362360000000001611173f73b16d40000000001811173fae1220c0000000001a11173fa0e811e0000000001c11173f7b6afd80000000001e11173f7d4af600000000002011173fe267c880000000002211173fcc10b120000000002411173f65915aa0000000002611173f72f85ea0000000002811173f599148600000000000191c3c0017000000000000000028000000\",\"subrequest_disabled\":False}",
"encoded_title":"WyJcdTAwMjVEMFx1MDAyNUJCXHUwMDI1RDBcdTAwMjVCMFx1MDAyNUQwXHUwMDI1QjJcdTAwMjVEMFx1MDAyNUIwXHUwMDI1RDBcdTAwMjVCQlx1MDAyNUQxXHUwMDI1OEMrXHUwMDI1RDBcdTAwMjVCRlx1MDAyNUQwXHUwMDI1QkVcdTAwMjVEMVx1MDAyNTgyXHUwMDI1RDBcdTAwMjVCRVx1MDAyNUQwXHUwMDI1QkEiXQ",
"ref":"unknown",
"logger_source":"www_main",
"typeahead_sid":"",
"tl_log":False,
"impression_id":"ed9cde39",
"filter_ids":{
"1597273353820386:1674330276114693:0":"1597273353820386:1674330276114693:0"
},
"experience_type":"grammar",
"exclude_ids":None,
"browse_location":"",
"trending_source":None,
"reaction_surface":None,
"reaction_session_id":None,
"ref_path":"/search/top/",
"is_trending":False,
"topic_id":None,
"place_id":None,
"story_id":None,
"callsite":"browse_ui:init_result_set",
"has_top_pagelet":True,
"display_params":{
"mrss":True
},
"cursor":"Abp0rWq8oGjiUWYmIeN9rZCuAXTubQ9beY7hyGlZpau3ekEF9BSelQe85TthKUvpoNEU65kQorg_Fya3xI47JPWGoJ-lNMS4JiOobTZ0Q3tP0HD1Z5JZiCLbT10PwrRNibnv-TKdTBhwtfMvqR816Hd9vIHPRxCBmT5lPfrVZC7f0ohVLeSCKFEYmP-47IiDsWW1YynB8Yqr_54b7iIQWB4uixrp5Zm5AHrCilxpqGtp9ye5Y2nKCyK8UtMkzzQ11CTfidmPmDMPQgU3rFroTvpUc96QGvfX1pNjNw3sn-CFyn5TLq_0mX_jOVP8BzfRP7qhnmcmjs3Rf2_l22Q9C-gQGqSwDUqE63XszHUYqEW5e-KtU_3Hcpb3OT0MJyZ7EQI",
"page_number":2,
"em":False,
"mr":False,
"tr":None
}
def scrape(self):
posts = self.scrape_posts()
for post in posts:
print ("Фейсбучный пост ", post)
def scrape_posts(self, max_pages=4):
posts = []
pageno = 2
cursor = [
'AbocHlVuS3n0hW0t-IUaCGN9y1jZzVg_cbHqG4IPXcnKhfacxLL52L4S1fMLklQPLgIBtRBA6z_hRaeCS0xzr1BCZbBe8fIdpVYMegK7Ye2TxzWSNRWUEJC0IMYWCjEkZQvI-Ix_Kx_E0Kx1oap8jGJAN9housnxkkAq8_ElwDTK9TbaHr0TB1MNNwR4lQU2PKYXOWajSG_0_AZ2DOCsn-DIMHL4jbhnhrwps_2kIi0gaC6y3aqbp9q8iILcwbXsjUzsTQce3tr3U9GQdVFClJQf2guaIwNa7KSmTEM99-SeNAMC07e8-VTCAd5Uc01qSa4yW_Asfl27xsXKbv9Aa5JBMt7fB8fvo1OBpOrU43Zg-lb1C7wAKoeqmo6bp2VfHVw',
'Abo8hIfmoANZ0PCtYHB4ooCJ59SHjd5JoFmxoE2nu99WKD5kwB8riOnI6OiqTTO3gnI2Gehgu8BONQytNPKWWgBPnOTV7OF1Rlwmp2bEO5tQfDEw3Vcjiy_X3QJe2bj74E-DV2qom6G75bL4tRa-zPi4JcGYOGWvBTFTabTHJR8fWIAK1NctX4_lztV-aaGAZanQvrcDKFP9gz7w5luvOo4Lv6eN4xfGlJwoEmyj9blI-EG1Ijc3lhKXrHse0hPSJlKaWVo4w1lkijdeJE1QyzW-WRtaGbm6FTLDrFaOeOnLp8g6LhS3nJ2X2yx6-9967VQbNtWUQ2dCs3QqomitMMuXkDb-B3ASJmtRc4krWmpi0-hN46Si2r_ntU4cSt5idmg'
]
dyn = [
'7AmajEzUGByA5Q9UoGya4A5EWq2W8GAdy8Z9LFwxBxCbzES2N6xybxu13wHgf8jyR88y8aGjzEgDKuEjKeCwxxW3Ouum2SUpGqewIUsz8nxm3a229yoOm8yUgx62q78vDw',
'7AmajEzUGByA5Q9UoGya4A5EWq2W8GAdy8Z9LFwxBxvyUWdwIhEoyUnwgUaQ3O4UJi28y2GAUW49XDG4XzFE8ouwYDDBwJK6qCzEbe78O5UlwOwwyoCcBy8K48hwCxO7VU'
]
req = [
'q',
'y'
]
self.data['page_number'] = pageno
while pageno < max_pages:
#self.data['cursor'] = cursor[pageno-2]
payload = {
'data': json.dumps(self.data),
'__dpr': 1,
'__user':100012747062538,
'__a':1,
'__dyn':'7AmajEzUGByA5Q9UoGya4A5EWq2WiWF3oyfirWo8popyUWdwIhEoyUnwgUat0Hx24UJi28y2GAUW49XDG4XzFE8ouwh9VobrxCFEW2PxOcxu5pUaE88C9z9oybx24oqyUsx-u6vU',
#'__dyn':dyn[pageno-2],
'__req':8,
'__be':-1,
'__pc':'PHASED:DEFAULT',
'__rev':2467498
}
#grab.cookies.load_from_file('cookies.html')
url='https://www.facebook.com/search/top/?init=quick&q=%D0%BB%D0%B0%D0%B2%D0%B0%D0%BB%D1%8C%20%D0%BF%D0%BE%D1%82%D0%BE%D0%BA&tas=0.715880302462869'
g = Grab(url=url, cookiefile='cookies.html', post=payload)
g.go(url=url)
r = g.response.unicode_body()
"""
post =
r = requests.post(
url='https://www.facebook.com/search/top/?init=quick&q=%D0%BB%D0%B0%D0%B2%D0%B0%D0%BB%D1%8C%20%D0%BF%D0%BE%D1%82%D0%BE%D0%BA&tas=0.715880302462869',
data=payload,
# 'X-Requested-With': 'XMLHttpRequest'
#}
)
"""
print ("---------------------- ↓r ", pageno , "↓ ------------------")
print(r)
print ("---------------------- ↑r ", pageno , "↑ ------------------")
# Next page
pageno += 1
self.data['page_number'] = pageno
return posts
def grab_demo(request):
# search page to scrape
page = "https://www.facebook.com/search/top/?init=quick&q=%D0%BB%D0%B0%D0%B2%D0%B0%D0%BB%D1%8C%20%D0%BF%D0%BE%D1%82%D0%BE%D0%BA&tas=0.715880302462869"
# id of user
parser_user_id = 100012747062538
#
page_number = 1
# Логинимся в фейсбуке
grab = Grab(log_file='out.html')
grab.go('https://www.facebook.com/')
grab.set_input("email", "your_email_here")
grab.set_input("pass", "your_password_here")
grab.submit()
s1 = grab.response.unicode_body()
grab.dump_cookies('cookies.html')
print ("---------------------- Login done ------------------")
print(s1)
# Login done
scraper = FacebookScraper()
scraper.scrape()
我认为这部分存在问题:
g = Grab(url=url, cookiefile='cookies.html', post=payload)
g.go(url=url)
r = g.response.unicode_body()
谁可以提供帮助?另外,我不想使用Selenium,因为它可以生成真正的浏览器来启动。