0

我正在尝试使用命令行实用程序 wayback-machine-scraper 从存档站点中提取数据。刮板需要在 Bash 中运行,但需要时区,我只能在 Python 3.X 中找到。如果我切换到 python,那么我会在 wayback-machine-scraper 上得到一个语法错误。我需要专门使用这个刮板,因为它允许搜索最近的存档站点和日期范围。

wayback-machine-scraper -o 'www.nytimes.com' www.nytimes.com

输出

    Traceback (most recent call last):
    File "/usr/local/bin/wayback-machine-scraper", line 11, in <module>
load_entry_point('wayback-machine-scraper==1.0.7', 'console_scripts', 'wayback-machine-scraper')() 
    File "/Users/username/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
    File "/Users/username/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
return ep.load()
    File "/Users/username/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2332, in load
return self.resolve()
    File "/Users/username/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2338, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
    File "/Library/Python/2.7/site-packages/wayback_machine_scraper/__main__.py", line 7, in <module>
from .mirror_spider import MirrorSpider
    File "/Library/Python/2.7/site-packages/wayback_machine_scraper/mirror_spider.py", line 7, in <module>
from scrapy_wayback_machine import WaybackMachineMiddleware
    File "/Library/Python/2.7/site-packages/scrapy_wayback_machine/__init__.py", line 2, in <module>
from datetime import datetime, timezone
    ImportError: cannot import name timezone

对不起,如果这不是完美的格式。这是我第一次在这里发帖。感谢你的帮助!

4

0 回答 0