Я получаю нулевые значения, даже видя, что в оболочке Scrapy значение не равно нулю
Я попытался очистить эту ссылку: https://www.chemicalbook.com/ProductChemicalPropertiesCB2909992_EN.htm
и получить название продукта, которое я использую:
response.css('.ProdSupplierGN_ProductA_2 .td1+ td a::text').get()
но когда я увидел вывод scrapy.json
, мои данные были:
{
"link":"https://www.chemicalbook.com/ProductChemicalPropertiesCB2909992_EN.htm",
"name":null,
"cas":null,
"synomym":[
],
"molecular_formula":null,
"molecular_weight":null,
"einecs":null,
"product_categories":[
],
"melting_point":null,
"vapor_pressure":[
],
"form":null,
"henry_law_constant":null,
"stability":null,
"inchikey":null,
"hazard_codes":null,
"risk_statements":null,
"safety_statements":null,
"wgk":null,
"tsca":null,
"packing_group":null,
"hs_code":null,
"hazardous_substance_data":null,
"chemical_properties":null,
"definition":null,
"air_and_water_reactions":null,
"general_description":null,
"reactivity_profile":null,
"fire_hazard":null
}
def parse_chemi_link(self, response):
items = ChemibookItem()
#------------------------------BASIC INFORMATION
link = response.url
name = response.css('.ProdSupplierGN_ProductA_2 .td1+ td a::text').get()
synomym = response.css('.ProdSupplierGN_ProductA_2+ .ProdSupplierGN_ProductA_2 td+ td font::text').getall()
items['link'] = link
items['name'] = name
items['synomym'] = synomym
yield items