facebook-scraper icon indicating copy to clipboard operation
facebook-scraper copied to clipboard

PytzUsageWarning: The localize method is no longer necessary

Open KhaledAnaqwa opened this issue 3 years ago • 4 comments

/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 avatar Dec 19 '21 18:12 KhaledAnaqwa

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.

KhaledAnaqwa avatar Dec 19 '21 19:12 KhaledAnaqwa

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

neon-ninja avatar Dec 19 '21 22:12 neon-ninja

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

5uru avatar Jan 18 '22 21:01 5uru

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

PierreMesure avatar Mar 16 '23 15:03 PierreMesure