代码 :
import scrapy
class BlogSpider(scrapy.Spider):
name = 'bijouterie'
start_urls = ['https://www.example.com']
def parse(self, response):
for post in response.css('#engine-results .drs'):
yield {'title': post.css('a.moodalbox.response').get()}
运行命令(Windows 10):
scrapy runspider C:\Users\DELL\Desktop\icscrape\bijouterie.py -o posts.csv
CSV 文件: https: //pastebin.com/qEQTKEcC
我只想抓取文本而不是整个 html 类代码。
Smart猫小萌
相关分类