AndreMiras / lbcscraper

Scraper for Leboncoin.fr
MIT License
4 stars 2 forks source link

Example doesn't work #6

Open jplumail opened 1 year ago

jplumail commented 1 year ago

After

$ scrapy crawl leboncoin_property -a start_urls="http://www.leboncoin.fr/ventes_immobilieres/offres/languedoc_roussillon/herault/" -o properties.json

properties.json is empty.

Console output:


2023-02-09 00:02:12 [scrapy.utils.log] INFO: Versions: lxml 4.9.2.0, libxml2 2.9.12, cssselect 1.2.0, parsel 1.7.0, w3lib 2.1.1, Twisted 22.10.0, Python 3.8.16 | packaged by conda-forge | (default, Feb  1 2023, 15:53:35) [MSC v.1929 64 bit (AMD64)], pyOpenSSL 23.0.0 (OpenSSL 3.0.8 7 Feb 2023), cryptography 39.0.1, Platform Windows-10-10.0.22621-SP0
2023-02-09 00:02:12 [scrapy.crawler] INFO: Overridden settings:
{'BOT_NAME': 'lbcscraper',
 'NEWSPIDER_MODULE': 'lbcscraper.spiders',
 'SPIDER_MODULES': ['lbcscraper.spiders']}
2023-02-09 00:02:12 [py.warnings] WARNING: C:\Users\jeanp\miniconda3\envs\sci\lib\site-packages\scrapy\utils\request.py:232: ScrapyDeprecationWarning: '2.6' is a deprecated value for the 'REQUEST_FINGERPRINTER_IMPLEMENTATION' setting.

It is also the default value. In other words, it is normal to get this warning if you have not defined a value for the 'REQUEST_FINGERPRINTER_IMPLEMENTATION' setting. This is so for backward compatibility reasons, but it will change in a future version of Scrapy.

See the documentation of the 'REQUEST_FINGERPRINTER_IMPLEMENTATION' setting for information on how to handle this deprecation.
  return cls(crawler)

2023-02-09 00:02:12 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor
2023-02-09 00:02:12 [scrapy.extensions.telnet] INFO: Telnet Password: 8cf3cb9e908ae9f1
2023-02-09 00:02:13 [scrapy.middleware] INFO: Enabled extensions:
['scrapy.extensions.corestats.CoreStats',
 'scrapy.extensions.telnet.TelnetConsole',
 'scrapy.extensions.feedexport.FeedExporter',
 'scrapy.extensions.logstats.LogStats']
2023-02-09 00:02:13 [scrapy.middleware] INFO: Enabled downloader middlewares:
['scrapy.downloadermiddlewares.httpauth.HttpAuthMiddleware',
 'scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddleware',
 'scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware',
 'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware',
 'scrapy.downloadermiddlewares.retry.RetryMiddleware',
 'scrapy.downloadermiddlewares.redirect.MetaRefreshMiddleware',
 'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware',
 'scrapy.downloadermiddlewares.redirect.RedirectMiddleware',
 'scrapy.downloadermiddlewares.cookies.CookiesMiddleware',
 'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware',
 'scrapy.downloadermiddlewares.stats.DownloaderStats']
2023-02-09 00:02:13 [scrapy.middleware] INFO: Enabled spider middlewares:
['scrapy.spidermiddlewares.httperror.HttpErrorMiddleware',
 'scrapy.spidermiddlewares.offsite.OffsiteMiddleware',
 'scrapy.spidermiddlewares.referer.RefererMiddleware',
 'scrapy.spidermiddlewares.urllength.UrlLengthMiddleware',
 'scrapy.spidermiddlewares.depth.DepthMiddleware']
2023-02-09 00:02:13 [scrapy.middleware] INFO: Enabled item pipelines:
[]
2023-02-09 00:02:13 [scrapy.core.engine] INFO: Spider opened
2023-02-09 00:02:13 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2023-02-09 00:02:13 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2023-02-09 00:02:13 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://www.leboncoin.fr/ventes_immobilieres/offres/languedoc_roussillon/herault/> from <GET http://www.leboncoin.fr/ventes_immobilieres/offres/languedoc_roussillon/herault/>     
2023-02-09 00:02:13 [scrapy.core.engine] DEBUG: Crawled (403) <GET https://www.leboncoin.fr/ventes_immobilieres/offres/languedoc_roussillon/herault/> (referer: None)
2023-02-09 00:02:13 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <403 https://www.leboncoin.fr/ventes_immobilieres/offres/languedoc_roussillon/herault/>: HTTP status code is not handled or not allowed
2023-02-09 00:02:13 [scrapy.core.engine] INFO: Closing spider (finished)
2023-02-09 00:02:13 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 544,
 'downloader/request_count': 2,
 'downloader/request_method_count/GET': 2,
 'downloader/response_bytes': 2996,
 'downloader/response_count': 2,
 'downloader/response_status_count/301': 1,
 'downloader/response_status_count/403': 1,
 'elapsed_time_seconds': 0.253891,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2023, 2, 8, 23, 2, 13, 657334),
 'httperror/response_ignored_count': 1,
 'httperror/response_ignored_status_count/403': 1,
 'log_count/DEBUG': 3,
 'log_count/INFO': 11,
 'log_count/WARNING': 1,
 'response_received_count': 1,
 'scheduler/dequeued': 2,
 'scheduler/dequeued/memory': 2,
 'scheduler/enqueued': 2,
 'scheduler/enqueued/memory': 2,
 'start_time': datetime.datetime(2023, 2, 8, 23, 2, 13, 403443)}
2023-02-09 00:02:13 [scrapy.core.engine] INFO: Spider closed (finished)```
AndreMiras commented 1 year ago

Yes indeed, I'm not surprised it doesn't work since it's a scrapper it's easily impacted by the changes they make to their HTML code. I haven't touched that for years and I don't know if they eventually provide an API, but until then scrappers will be fragile and require regular updates to match the HTML changes they make