Python Scrapy CSS选择器返回空白

Python Scrapy CSS选择器返回空白,python,web-scraping,scrapy,Python,Web Scraping,Scrapy,我目前正试图在一个网站上从每家餐厅中获取href元素,如: 相关html可在以下网址找到: 然而,当我在scrapy shell中使用下面的代码时,它什么也不返回 response.css("div.c-listing>div>div") 我想知道为什么会这样/我能做些什么来解决这个问题 谢谢大家! 使用此css选择器'a.c-listing-item-link.u-clearfix'提取scrapy shell中的url链接 >>> fo

我目前正试图在一个网站上从每家餐厅中获取href元素,如:

相关html可在以下网址找到:

然而,当我在scrapy shell中使用下面的代码时,它什么也不返回

response.css("div.c-listing>div>div")
我想知道为什么会这样/我能做些什么来解决这个问题


谢谢大家!

使用此css选择器
'a.c-listing-item-link.u-clearfix'
提取scrapy shell中的url链接

>>> for url in response.css('a.c-listing-item-link.u-clearfix ::attr("href")').extract():
...     print(response.urljoin(url))
... 
https://www.menulog.com.au/restaurants-blazin-grillz-liverpool/menu
https://www.menulog.com.au/restaurants-phillies-liverpool/menu
https://www.menulog.com.au/restaurants-mcdonalds-liverpool-south/menu
https://www.menulog.com.au/restaurants-kfc-liverpool/menu
https://www.menulog.com.au/restaurants-omer-biryani-house-liverpool/menu
https://www.menulog.com.au/restaurants-classic-burger-liverpool/menu
https://www.menulog.com.au/restaurants-jasmin-1-liverpool/menu
https://www.menulog.com.au/restaurants-subway-liverpool/menu
https://www.menulog.com.au/restaurants-himalayas-indian-restaurant-liverpool/menu
https://www.menulog.com.au/restaurants-jasmins-liverpool/menu
https://www.menulog.com.au/restaurants-sharetea-liverpool/menu
https://www.menulog.com.au/restaurants-healthy-kitchen-liverpool-halal/menu
https://www.menulog.com.au/restaurants-dosa-hut-liverpool/menu
https://www.menulog.com.au/restaurants-the-kulcha-house-liverpool/menu
https://www.menulog.com.au/restaurants-biang-biang-noodle-shop-liverpool/menu
https://www.menulog.com.au/restaurants-zambeekas-liverpool/menu
https://www.menulog.com.au/restaurants-mina-bakery-liverpool/menu
https://www.menulog.com.au/restaurants-crossroads-hotel-liverpool/menu
https://www.menulog.com.au/restaurants-nutrition-station-liverpool/menu
https://www.menulog.com.au/restaurants-mizuki-sushi-liverpool/menu