我想爬网网站:https://www.zappos.com/p/lamade-mozza-halter-pullover-black/product/9796103/color/3用户复查部分,但返回空结果,说明选择器的路径正确。
import scrapy
from scrapy import Selector,Request
class LaptopSpider(scrapy.Spider):
name = 'cs'
def start_requests(self):
url =' https://www.zappos.com/p/lamade-mozza-halter-pullover-black/product/9796103/color/3'
yield Request(url,callback=self.parse)
def parse(self, response):
products_selector = response.css('#productRecap > div.p--z > div:nth-child(3) > div > div > div > div > div.Oi-z > div::text').get()
print(products_selector)
1条答案
按热度按时间lb3vh1jj1#
请尝试以下方法从帖子中的链接获取评论: