Closed chelsas69 closed 5 years ago
fbcrawl works only with pages, not with personal profiles, and it's not supposed to. you might want to try something like this https://github.com/harismuneer/Ultimate-Facebook-Scraper
Hello again I also have a problem , When it comes to scratching Donald Trump's Facebook,please help me :
C:\Users\ASUS\Downloads\fbcrawl-master\fbcrawl-master\fbcrawl>scrapy crawl fb -a email="-------------------@gmail.com" -a password="-----------" -a page="DonaldTrump" -a year="2019" -a lang="en" -o Donald.csv
2019-09-17 15:13:43 [scrapy.utils.log] INFO: Scrapy 1.7.3 started (bot: fbcrawl)
2019-09-17 15:13:43 [scrapy.utils.log] INFO: Versions: lxml 4.4.1.0, libxml2 2.9.9, cssselect 1.1.0, parsel 1.5.2, w3lib 1.21.0, Twisted 19.7.0, Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)], pyOpenSSL 19.0.0 (OpenSSL 1.1.1d 10 Sep 2019), cryptography 2.7, Platform Windows-10-10.0.18362-SP0
2019-09-17 15:13:43 [scrapy.crawler] INFO: Overridden settings: {'BOT_NAME': 'fbcrawl', 'DOWNLOAD_DELAY': 3, 'DUPEFILTER_CLASS': 'scrapy.dupefilters.BaseDupeFilter', 'FEED_EXPORT_ENCODING': 'utf-8', 'FEED_EXPORT_FIELDS': ['source', 'shared_from', 'date', 'text', 'reactions', 'likes', 'ahah', 'love', 'wow', 'sigh', 'grrr', 'comments', 'post_id', 'url'], 'FEED_FORMAT': 'csv', 'FEED_URI': '2.csv', 'LOG_LEVEL': 'INFO', 'NEWSPIDER_MODULE': 'fbcrawl.spiders', 'SPIDER_MODULES': ['fbcrawl.spiders'], 'URLLENGTH_LIMIT': 99999, 'USER_AGENT': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'}
2019-09-17 15:13:43 [scrapy.extensions.telnet] INFO: Telnet Password: 44e58776fa8917a0
2019-09-17 15:13:43 [scrapy.middleware] INFO: Enabled extensions:
['scrapy.extensions.corestats.CoreStats',
'scrapy.extensions.telnet.TelnetConsole',
'scrapy.extensions.feedexport.FeedExporter',
'scrapy.extensions.logstats.LogStats']
2019-09-17 15:13:43 [fb] INFO: Email and password provided, will be used to log in
2019-09-17 15:13:43 [fb] INFO: Date attribute not provided, scraping date set to 2004-02-04 (fb launch date)
2019-09-17 15:13:43 [fb] INFO: Language attribute recognized, using "en" for the facebook interface
2019-09-17 15:13:43 [scrapy.core.engine] INFO: Spider opened
2019-09-17 15:13:43 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2019-09-17 15:13:43 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2019-09-17 15:13:54 [fb] INFO: Scraping facebook page https://mbasic.facebook.com/checkpoint/DonaldTrump
2019-09-17 15:13:57 [fb] INFO: [!] "more" link not found, will look for a "year" link
2019-09-17 15:13:57 [scrapy.core.scraper] ERROR: Spider error processing <GET https://mbasic.facebook.com/checkpoint/DonaldTrump> (referer: https://mbasic.facebook.com/checkpoint/?_rdr)
Traceback (most recent call last):
File "c:\users\asus\anaconda3\lib\site-packages\scrapy\utils\defer.py", line 102, in iter_errback
yield next(it)
File "c:\users\asus\anaconda3\lib\site-packages\scrapy\core\spidermw.py", line 84, in evaluate_iterable
for r in iterable:
File "c:\users\asus\anaconda3\lib\site-packages\scrapy\spidermiddlewares\offsite.py", line 29, in process_spider_output
for x in result:
File "c:\users\asus\anaconda3\lib\site-packages\scrapy\core\spidermw.py", line 84, in evaluate_iterable
for r in iterable:
File "c:\users\asus\anaconda3\lib\site-packages\scrapy\spidermiddlewares\referer.py", line 339, in
I got the same problem here.
Hello again I have a problem and there are Facebook profiles in which I get the following error that I show below. When it comes to scratching Donald Trump's Facebook, for example, I have no problems and it works perfectly.
Thank you.
scrapy crawl fb -a email="-------@gmail.com" -a password="-------" -a page="fiorela.alvaradoleon" -a year="2019" -a lang="en" -o 2.csv 2019-02-27 12:22:23 [scrapy.utils.log] INFO: Scrapy 1.5.2 started (bot: fbcrawl) 2019-02-27 12:22:23 [scrapy.utils.log] INFO: Versions: lxml 4.3.0.0, libxml2 2.9.9, cssselect 1.0.3, parsel 1.5.1, w3lib 1.20.0, Twisted 18.9.0, Python 3.6.7 (default, Oct 22 2018, 11:32:17) - [GCC 8.2.0], pyOpenSSL 19.0.0 (OpenSSL 1.1.1a 20 Nov 2018), cryptography 2.1.4, Platform Linux-4.15.0-45-generic-x86_64-with-Ubuntu-18.04-bionic 2019-02-27 12:22:23 [scrapy.crawler] INFO: Overridden settings: {'BOT_NAME': 'fbcrawl', 'FEED_EXPORT_ENCODING': 'utf-8', 'FEED_EXPORT_FIELDS': ['source', 'shared_from', 'date', 'text', 'reactions', 'likes', 'ahah', 'love', 'wow', 'sigh', 'grrr', 'comments', 'url'], 'FEED_FORMAT': 'csv', 'FEED_URI': '2.csv', 'LOG_LEVEL': 'INFO', 'NEWSPIDER_MODULE': 'fbcrawl.spiders', 'SPIDER_MODULES': ['fbcrawl.spiders'], 'USER_AGENT': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'} 2019-02-27 12:22:23 [scrapy.extensions.telnet] INFO: Telnet Password: --- 2019-02-27 12:22:23 [scrapy.middleware] INFO: Enabled extensions: ['scrapy.extensions.corestats.CoreStats', 'scrapy.extensions.telnet.TelnetConsole', 'scrapy.extensions.memusage.MemoryUsage', 'scrapy.extensions.feedexport.FeedExporter', 'scrapy.extensions.logstats.LogStats'] 2019-02-27 12:22:23 [fb] INFO: Email and password provided, using these as credentials 2019-02-27 12:22:23 [fb] INFO: Page attribute provided, scraping "fiorela.alvaradoleon" 2019-02-27 12:22:23 [fb] INFO: Year attribute found, set scraping back to 2019 2019-02-27 12:22:23 [fb] INFO: Language attribute recognized, using "en" for the facebook interface 2019-02-27 12:22:24 [scrapy.core.engine] INFO: Spider opened 2019-02-27 12:22:24 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min) 2019-02-27 12:22:26 [fb] INFO: Got stuck in "save-device" checkpoint 2019-02-27 12:22:26 [fb] INFO: I will now try to redirect to the correct page 2019-02-27 12:22:27 [fb] INFO: Scraping facebook page https://mbasic.facebook.com/fiorela.alvaradoleon 2019-02-27 12:22:28 [scrapy.core.scraper] ERROR: Spider error processing <GET https://mbasic.facebook.com/fiorela.alvaradoleon> (referer: https://mbasic.facebook.com/home.php?_rdr) Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/scrapy/utils/defer.py", line 102, in iter_errback yield next(it) File "/usr/local/lib/python3.6/dist-packages/scrapy/spidermiddlewares/offsite.py", line 30, in process_spider_output for x in result: File "/usr/local/lib/python3.6/dist-packages/scrapy/spidermiddlewares/referer.py", line 339, in
return (_set_referer(r) for r in result or ())
File "/usr/local/lib/python3.6/dist-packages/scrapy/spidermiddlewares/urllength.py", line 37, in
return (r for r in result or () if _filter(r))
File "/usr/local/lib/python3.6/dist-packages/scrapy/spidermiddlewares/depth.py", line 58, in
return (r for r in result or () if _filter(r))
File "/fbcrawl-master/fbcrawl/spiders/fbcrawl.py", line 158, in parse_page
if response.meta['flag'] == self.k and self.k >= self.year:
KeyError: 'flag'
2019-02-27 12:22:28 [scrapy.core.engine] INFO: Closing spider (finished)
2019-02-27 12:22:28 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 3869,
'downloader/request_count': 6,
'downloader/request_method_count/GET': 4,
'downloader/request_method_count/POST': 2,
'downloader/response_bytes': 30486,
'downloader/response_count': 6,
'downloader/response_status_count/200': 4,
'downloader/response_status_count/302': 2,
'finish_reason': 'finished',
'finish_time': datetime.datetime(2019, 2, 27, 11, 22, 28, 520792),
'log_count/ERROR': 1,
'log_count/INFO': 12,
'memusage/max': 50511872,
'memusage/startup': 50511872,
'request_depth_max': 3,
'response_received_count': 4,
'scheduler/dequeued': 6,
'scheduler/dequeued/memory': 6,
'scheduler/enqueued': 6,
'scheduler/enqueued/memory': 6,
'spider_exceptions/KeyError': 1,
'start_time': datetime.datetime(2019, 2, 27, 11, 22, 24, 170753)}
2019-02-27 12:22:28 [scrapy.core.engine] INFO: Spider closed (finished)