kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.42k stars 631 forks source link

PytzUsageWarning: The localize method is no longer necessary #601

Open KhaledAnaqwa opened 2 years ago

KhaledAnaqwa commented 2 years ago

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/dateparser/date_parser.py:35: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html date_obj = stz.localize(date_obj)

KhaledAnaqwa commented 2 years ago

PytzUsageWarning comes from pytz_deprecation_shim package which is the dependency of tzlocal. tzlocal is deeply integrated with pytz.

pip install tzlocal==2.1

But, please, pay attention it could break other project dependencies, so be careful.

neon-ninja commented 2 years ago

This sounds like an issue for dateparser, not facebook-scraper. In fact, several people have already raised this in dateparser's issue tracker, see https://github.com/scrapinghub/dateparser/issues/1013

5uru commented 2 years ago

thank you very much you helped me a lot it works to scrape the pages I no longer use cookies and I installed tzlocal==2.1

PierreMesure commented 1 year ago

The problem was fixed in dateparser 1.1.2, would you like a PR to update the dependency?