我有一个基本的代码,旨在废弃'quotes.com'和检索两个页面的标题,使用scrapy库:
import scrapy
class Crawler(scrapy.Spider):
name = "quotes"
start_urls = [
"https://quotes.toscrape.com/page/1/",
"https://quotes.toscrape.com/page/2/",
]
def parse(self, response):
print(response.css("title::text").get())
在我的苹果MacbookPro(m1 pro芯片)上,它给了我一个'MemoryError':
MemoryError: Cannot allocate write+execute memory for ffi.callback().
You might be running on a system that prevents this.
For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks
我该怎么做才能让它发挥作用呢?
1条答案
按热度按时间zfycwa2u1#
使用Python 3.10环境对我来说很有用。