kandi background
Explore Kits

mall | mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBootMyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理 | Microservice library

 by   macrozheng Java Version: v1.0.1 License: Apache-2.0

 by   macrozheng Java Version: v1.0.1 License: Apache-2.0

Download this library from

kandi X-RAY | mall Summary

mall is a Java library typically used in Architecture, Microservice, MongoDB, Spring Boot, Spring, Docker, RabbitMQ applications. mall has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub.
mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • mall has a medium active ecosystem.
  • It has 52180 star(s) with 22319 fork(s). There are 2144 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 19 open issues and 381 have been closed. On average issues are closed in 23 days. There are 3 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of mall is v1.0.1
mall Support
Best in #Microservice
Average in #Microservice
mall Support
Best in #Microservice
Average in #Microservice

quality kandi Quality

  • mall has 0 bugs and 0 code smells.
mall Quality
Best in #Microservice
Average in #Microservice
mall Quality
Best in #Microservice
Average in #Microservice

securitySecurity

  • mall has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • mall code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
mall Security
Best in #Microservice
Average in #Microservice
mall Security
Best in #Microservice
Average in #Microservice

license License

  • mall is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
mall License
Best in #Microservice
Average in #Microservice
mall License
Best in #Microservice
Average in #Microservice

buildReuse

  • mall releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • mall saves you 79893 person hours of effort in developing the same functionality from scratch.
  • It has 88373 lines of code, 14311 functions and 639 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
mall Reuse
Best in #Microservice
Average in #Microservice
mall Reuse
Best in #Microservice
Average in #Microservice
Top functions reviewed by kandi - BETA

kandi has reviewed mall and discovered the below as its top functions. This is intended to give you an instant insight into mall implemented functionality, and help decide if they suit your requirements.

  • Generate order .
  • Calculate promotion list .
  • get the list of SMSCoupons
  • Get a list of products for the database
  • Handle update sku list .
  • get authorization policy
  • Around join point .
  • Register member .
  • Gets the request IP address .
  • Configure the http security .

mall Key Features

mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。

组织结构

copy iconCopydownload iconDownload
mall
├── mall-common -- 工具类及通用代码
├── mall-mbg -- MyBatisGenerator生成的数据库操作代码
├── mall-security -- SpringSecurity封装公用模块
├── mall-admin -- 后台商城管理系统接口
├── mall-search -- 基于Elasticsearch的商品搜索系统
├── mall-portal -- 前台商城系统接口
└── mall-demo -- 框架搭建时的测试代码

Set rows to datagrid React

copy iconCopydownload iconDownload
  let rows: any[] = [];
const [rows,setRows] = useState<any[]>([])
-----------------------
  let rows: any[] = [];
const [rows,setRows] = useState<any[]>([])

How to fix &quot;LateInitializationError: Field 'data' has not been initialized error&quot;

copy iconCopydownload iconDownload
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
      home: HomePage(),
    ));

class HomePage extends StatefulWidget {
  @override
  HomePageState createState() => HomePageState();
}

class HomePageState extends State<HomePage> {
  late final Future<List<Map<String, dynamic>>> _getJsonDataFuture;
  @override
  void initState() {
    super.initState();
    _getJsonDataFuture = getJsonData();
  }

  Future<List<Map<String, dynamic>>> getJsonData() async {
    // simulate delay
    await Future.delayed(const Duration(seconds: 2));

    var response = [
      {"id": 1, "name": "first"},
      {"id": 2, "name": "second"},
      {"id": 3, "name": "third"}
    ];

    return Future.value(response);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: const Text("Where to Eat")),
        body: FutureBuilder<List<Map<String, dynamic>>>(
            future: _getJsonDataFuture,
            builder: (context, snapshot) {
              // while loading
              if (snapshot.connectionState == ConnectionState.waiting) {
                return const Center(child: CircularProgressIndicator());
              }
              // on error
              if (snapshot.hasError) {
                return Center(child: Text('Snapshot error: ${snapshot.error}'));
              }

              // on data received from future
              if (snapshot.hasData && snapshot.data != null) {
                return ListView.builder(
                    itemCount: snapshot.data!.length,
                    itemBuilder: (BuildContext context, int index) => Card(
                          child: Container(
                            child: Text(snapshot.data![index]['name']),
                            padding: const EdgeInsets.all(20.0),
                          ),
                        ));
              }

              // on missing data
              return const Center(child: Text('Missing data'));
            }));
  }
}

Flag geocoding errors in R using the ggmap package

copy iconCopydownload iconDownload
  ## format geocoded data
  
  gcdf <- with(gc$results[[2]], {
    tibble(
      "lon" = NULLtoNA(geometry$location$lng),
      "lat" = NULLtoNA(geometry$location$lat),
      "type" = tolower(NULLtoNA(types[2])),
      "loctype" = tolower(NULLtoNA(geometry$location_type)),
      "address" = location, # dsk doesn't give the address
      "north" = NULLtoNA(geometry$viewport$northeast$lat),
      "south" = NULLtoNA(geometry$viewport$southwest$lat),
      "east" = NULLtoNA(geometry$viewport$northeast$lng),
      "west" = NULLtoNA(geometry$viewport$southwest$lng),
      'status' = NULLtoNA(length(gc$results)) # new!
    )
  })
  
  if (length(gc$results) > 1L) { # new!
   
   gcdf$address2 <- tolower(NULLtoNA(gc$results[[2]]$formatted_address))
    
  } else {
    
  gcdf$address2 <- "NA"
    
    

  }


  # add address
  if (source == "google") gcdf$address <- tolower(NULLtoNA(gc$results[[2]]$formatted_address))
  if (output == "latlon") return(gcdf[,c("lon","lat", "status", "address", "address2")]) # new!
environment(geocode) <- asNamespace('ggmap')
assignInNamespace("geocode", geocode, ns = "ggmap")
-----------------------
  ## format geocoded data
  
  gcdf <- with(gc$results[[2]], {
    tibble(
      "lon" = NULLtoNA(geometry$location$lng),
      "lat" = NULLtoNA(geometry$location$lat),
      "type" = tolower(NULLtoNA(types[2])),
      "loctype" = tolower(NULLtoNA(geometry$location_type)),
      "address" = location, # dsk doesn't give the address
      "north" = NULLtoNA(geometry$viewport$northeast$lat),
      "south" = NULLtoNA(geometry$viewport$southwest$lat),
      "east" = NULLtoNA(geometry$viewport$northeast$lng),
      "west" = NULLtoNA(geometry$viewport$southwest$lng),
      'status' = NULLtoNA(length(gc$results)) # new!
    )
  })
  
  if (length(gc$results) > 1L) { # new!
   
   gcdf$address2 <- tolower(NULLtoNA(gc$results[[2]]$formatted_address))
    
  } else {
    
  gcdf$address2 <- "NA"
    
    

  }


  # add address
  if (source == "google") gcdf$address <- tolower(NULLtoNA(gc$results[[2]]$formatted_address))
  if (output == "latlon") return(gcdf[,c("lon","lat", "status", "address", "address2")]) # new!
environment(geocode) <- asNamespace('ggmap')
assignInNamespace("geocode", geocode, ns = "ggmap")

How to transform scraping results into dict to create data frame?

copy iconCopydownload iconDownload
{x.get('class')[0]: x.text for x in li.select('span')} 
df['employee'] = df.apply(lambda x: ''.join(x['employee'].strip('-').split(x['contractor'], 1)), axis=1)
from bs4 import BeautifulSoup
import pandas as pd

html='''
<li>
<span class="name">Person One</span>
<span class="organization">Mall</span>
<span class="employee">-Yes<span class="contractor yes">Yes</span></span>
</li>

<li>
<span class="name">Person Two</span>
<span class="organization">Market</span>
<span class="employee">-Yes<span class="contractor yes">Yes</span></span>
</li>

<li>
<span class="name">Person Three</span>
<span class="organization">Mall</span>
<span class="employee">-Yes<span class="contractor no">No</span></span>
</li>
'''

soup = BeautifulSoup(html)

data = []
for li in soup.select('li'):
    data.append({x.get('class')[0]: x.text for x in li.select('span')})

df = pd.DataFrame(data)
df['employee'] = df.apply(lambda x: ''.join(x['employee'].strip('-').split(x['contractor'], 1)), axis=1)
df
-----------------------
{x.get('class')[0]: x.text for x in li.select('span')} 
df['employee'] = df.apply(lambda x: ''.join(x['employee'].strip('-').split(x['contractor'], 1)), axis=1)
from bs4 import BeautifulSoup
import pandas as pd

html='''
<li>
<span class="name">Person One</span>
<span class="organization">Mall</span>
<span class="employee">-Yes<span class="contractor yes">Yes</span></span>
</li>

<li>
<span class="name">Person Two</span>
<span class="organization">Market</span>
<span class="employee">-Yes<span class="contractor yes">Yes</span></span>
</li>

<li>
<span class="name">Person Three</span>
<span class="organization">Mall</span>
<span class="employee">-Yes<span class="contractor no">No</span></span>
</li>
'''

soup = BeautifulSoup(html)

data = []
for li in soup.select('li'):
    data.append({x.get('class')[0]: x.text for x in li.select('span')})

df = pd.DataFrame(data)
df['employee'] = df.apply(lambda x: ''.join(x['employee'].strip('-').split(x['contractor'], 1)), axis=1)
df
-----------------------
{x.get('class')[0]: x.text for x in li.select('span')} 
df['employee'] = df.apply(lambda x: ''.join(x['employee'].strip('-').split(x['contractor'], 1)), axis=1)
from bs4 import BeautifulSoup
import pandas as pd

html='''
<li>
<span class="name">Person One</span>
<span class="organization">Mall</span>
<span class="employee">-Yes<span class="contractor yes">Yes</span></span>
</li>

<li>
<span class="name">Person Two</span>
<span class="organization">Market</span>
<span class="employee">-Yes<span class="contractor yes">Yes</span></span>
</li>

<li>
<span class="name">Person Three</span>
<span class="organization">Mall</span>
<span class="employee">-Yes<span class="contractor no">No</span></span>
</li>
'''

soup = BeautifulSoup(html)

data = []
for li in soup.select('li'):
    data.append({x.get('class')[0]: x.text for x in li.select('span')})

df = pd.DataFrame(data)
df['employee'] = df.apply(lambda x: ''.join(x['employee'].strip('-').split(x['contractor'], 1)), axis=1)
df

Android Null Pointer Exception 2 Fragments 1 Activity?

copy iconCopydownload iconDownload
    textView = (TextView)getActivity().findViewById(R.id.textView1);
    textView = view.findViewById(R.id.textView1);
-----------------------
    textView = (TextView)getActivity().findViewById(R.id.textView1);
    textView = view.findViewById(R.id.textView1);

Android App - Error Crashing - ListView SetAdapter

copy iconCopydownload iconDownload
@Override
public void onCreate(....){
 .......
 .....
 textView = (TextView)getActivity().findViewById(R.id.textView1); //remove this line of code.
}

@Override
public View onCreateView(......){
 View view = inflater.inflate(R.layout.fragment_text, container, false);
 textView = view.findViewById(R.id.textView1); //you need to initialize textview here.
 return view;
}
@Override
public void onCreate(...){
 .......
 ....
 ...
 //remove all this code to another method.
 /*listView = (ListView)getActivity().findViewById(R.id.listView1);
 //Resources res = getResources();
 array = getResources().getStringArray(R.array.string_array_cities);
 ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, array);
 listView.setAdapter(adapter);*/
}

@Override
 public View onCreateView(.....){
  View view = inflater.inflate(R.layout.fragment_list, container, false);
  listView = view.findViewById(R.id.listView1);
  array = getResources().getStringArray(R.array.string_array_cities);
  ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, array);
  listView.setAdapter(adapter);
  return view;
 }
  // Add this code in your updated code.you need to override onAttach method
 @Override
 public void onAttach(@NonNull @NotNull Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener){
        listener = (OnFragmentInteractionListener) context;
    }
    else {
        throw new RuntimeException(context.toString());
    }
 }
-----------------------
@Override
public void onCreate(....){
 .......
 .....
 textView = (TextView)getActivity().findViewById(R.id.textView1); //remove this line of code.
}

@Override
public View onCreateView(......){
 View view = inflater.inflate(R.layout.fragment_text, container, false);
 textView = view.findViewById(R.id.textView1); //you need to initialize textview here.
 return view;
}
@Override
public void onCreate(...){
 .......
 ....
 ...
 //remove all this code to another method.
 /*listView = (ListView)getActivity().findViewById(R.id.listView1);
 //Resources res = getResources();
 array = getResources().getStringArray(R.array.string_array_cities);
 ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, array);
 listView.setAdapter(adapter);*/
}

@Override
 public View onCreateView(.....){
  View view = inflater.inflate(R.layout.fragment_list, container, false);
  listView = view.findViewById(R.id.listView1);
  array = getResources().getStringArray(R.array.string_array_cities);
  ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, array);
  listView.setAdapter(adapter);
  return view;
 }
  // Add this code in your updated code.you need to override onAttach method
 @Override
 public void onAttach(@NonNull @NotNull Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener){
        listener = (OnFragmentInteractionListener) context;
    }
    else {
        throw new RuntimeException(context.toString());
    }
 }

scrapy : spider not found (name or get no data ? )

copy iconCopydownload iconDownload
import scrapy
from bs4 import BeautifulSoup

class yahooCrawler(scrapy.Spider):
   name = "yahoo"
   start_urls = ['https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F']
   def parse(self,response):
       res = BeautifulSoup(response.body)
       for product in res.find_all("span",class_="BaseGridItem__title___2HWui"):
           #print(product.text)
           yield {'product':product.text}    
{'product': '乙)綠油精 Green Oil 5g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '沙威隆-抗菌潔淨洗手乳250ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '凡士林原味瓶裝護脣膏7g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '乙)曼秀雷敦 35g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'AIRWAVES 超涼薄荷無糖口香糖【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '媚點media 自轉式唇線筆 RS-3【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏袖珍面紙10抽30入(Shibainc)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Airwave Super 極酷嗆涼無糖口香糖-紫冰野莓口味【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏壓邊化妝棉100片'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏小蒼蘭淨潤沐浴乳1000ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏纖細柔軟牙刷(軟毛)1入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'HK-462 2入修眉刀L型【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '茶山房 蘭花皂 100G【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏 Collagen 活妍肌密眼部緊緻精華 20ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '澎澎MAN香浴乳補充包-茶樹精油700g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '沙威隆抗菌潔淨沐浴乳-天然茶樹精油1000ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏身體磨砂膏200g-洋甘菊蘆薈'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '日本JACKS 齒間刷15入3號-(S)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏潔膚柔濕巾10片3包入-薰衣草'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '美粒果白葡萄汁特加清新蘆薈粒 500ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏Q10緊緻柔膚乳液480ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Plantur 39植物與咖啡因洗髮露-染燙及受損髮質250ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '固力果 巧克力棒 40g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '銀離子除臭噴霧(鞋內專用)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '蘇菲超熟睡超薄細緻棉柔41.5cm 8片裝【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M舒適繃 20片入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Naturals by Watsons 茶樹舒緩精油 10ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏備長炭牙刷(軟毛)1入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏纖細柔軟牙刷(軟毛)4+1支'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏多用途濕巾90片'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '一匙靈亮彩超濃縮洗衣粉3D增豔力縯粉花朵香氛1.9kg【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '日本EBISU 柯南 3~6歲兒童牙刷【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '康乃馨透氣超薄護墊微香40片4包【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏廚房萬用紙巾112組6捲入(Shibainc)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏超細滑圓線護理牙線棒50支(附隨身盒)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏抽取式衛生紙110抽10包入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Naturals by Watsons 精萃玫瑰潤唇膏 4.5g (new)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '樂絲朵 立體持捲雙效乳 200ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M 細滑牙線棒150支附隨身盒【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '阿葵亞淨水賦活涼感洗潤組(屈臣氏獨家)(600ml+600ml)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Miine五角乳膠粉撲/10入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'GATSBY塑型噴霧45g(金)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏抗菌潔淨柔濕巾20片(綠圓點)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Eclipse 易口舒 無糖薄荷錠 繽紛野莓 31g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '保力達 葡萄C錠【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '丸三 五層可撕型敷面化妝棉 80片【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '乙)綠油精 10g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏潔膚柔濕巾10片3包入-櫻花'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏抽取式廚房萬用紙巾100抽3包入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏旅行包面紙100抽3包(鳳梨西瓜)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M Nexcare 深層潔淨抗痘洗面乳  100g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '白蘭氏 旭沛人蔘蜆精 60ml 15瓶裝【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M  立體密實袋大型15入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M 立體密實袋中型25入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '『美好人生』比爾A+幼兒營養穀奶(900g/罐)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '『美好人生』紅豆紅棗八寶飲粉(600g/2罐)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '去味大師竹木香-淡雅茉莉【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Alpecin 咖啡因洗髮露 250ML【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'GATSBY 造型髮雕霜(強黏性) 200g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏圓線護理牙線棒50支4盒'}
2021-11-28 15:47:49 [scrapy.core.engine] INFO: Closing spider (finished)
2021-11-28 15:47:49 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 341,
 'downloader/request_count': 1,
 'downloader/request_method_count/GET': 1,
 'downloader/response_bytes': 60279,
 'downloader/response_count': 1,
 'downloader/response_status_count/200': 1,
 'elapsed_time_seconds': 1.335299,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2021, 11, 28, 9, 47, 49, 895142),
 'httpcompression/response_bytes': 800701,
 'httpcompression/response_count': 1,
 'item_scraped_count': 60,

             
-----------------------
import scrapy
from bs4 import BeautifulSoup

class yahooCrawler(scrapy.Spider):
   name = "yahoo"
   start_urls = ['https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F']
   def parse(self,response):
       res = BeautifulSoup(response.body)
       for product in res.find_all("span",class_="BaseGridItem__title___2HWui"):
           #print(product.text)
           yield {'product':product.text}    
{'product': '乙)綠油精 Green Oil 5g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '沙威隆-抗菌潔淨洗手乳250ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '凡士林原味瓶裝護脣膏7g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '乙)曼秀雷敦 35g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'AIRWAVES 超涼薄荷無糖口香糖【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '媚點media 自轉式唇線筆 RS-3【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏袖珍面紙10抽30入(Shibainc)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Airwave Super 極酷嗆涼無糖口香糖-紫冰野莓口味【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏壓邊化妝棉100片'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏小蒼蘭淨潤沐浴乳1000ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏纖細柔軟牙刷(軟毛)1入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'HK-462 2入修眉刀L型【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '茶山房 蘭花皂 100G【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏 Collagen 活妍肌密眼部緊緻精華 20ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '澎澎MAN香浴乳補充包-茶樹精油700g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '沙威隆抗菌潔淨沐浴乳-天然茶樹精油1000ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏身體磨砂膏200g-洋甘菊蘆薈'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '日本JACKS 齒間刷15入3號-(S)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏潔膚柔濕巾10片3包入-薰衣草'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '美粒果白葡萄汁特加清新蘆薈粒 500ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏Q10緊緻柔膚乳液480ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Plantur 39植物與咖啡因洗髮露-染燙及受損髮質250ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '固力果 巧克力棒 40g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '銀離子除臭噴霧(鞋內專用)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '蘇菲超熟睡超薄細緻棉柔41.5cm 8片裝【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M舒適繃 20片入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Naturals by Watsons 茶樹舒緩精油 10ml'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏備長炭牙刷(軟毛)1入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏纖細柔軟牙刷(軟毛)4+1支'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏多用途濕巾90片'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '一匙靈亮彩超濃縮洗衣粉3D增豔力縯粉花朵香氛1.9kg【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '日本EBISU 柯南 3~6歲兒童牙刷【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '康乃馨透氣超薄護墊微香40片4包【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏廚房萬用紙巾112組6捲入(Shibainc)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏超細滑圓線護理牙線棒50支(附隨身盒)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏抽取式衛生紙110抽10包入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Naturals by Watsons 精萃玫瑰潤唇膏 4.5g (new)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '樂絲朵 立體持捲雙效乳 200ml【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M 細滑牙線棒150支附隨身盒【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '阿葵亞淨水賦活涼感洗潤組(屈臣氏獨家)(600ml+600ml)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Miine五角乳膠粉撲/10入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'GATSBY塑型噴霧45g(金)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏抗菌潔淨柔濕巾20片(綠圓點)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Eclipse 易口舒 無糖薄荷錠 繽紛野莓 31g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '保力達 葡萄C錠【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '丸三 五層可撕型敷面化妝棉 80片【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '乙)綠油精 10g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏潔膚柔濕巾10片3包入-櫻花'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏抽取式廚房萬用紙巾100抽3包入'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏旅行包面紙100抽3包(鳳梨西瓜)'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M Nexcare 深層潔淨抗痘洗面乳  100g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '白蘭氏 旭沛人蔘蜆精 60ml 15瓶裝【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M  立體密實袋大型15入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '3M 立體密實袋中型25入【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '『美好人生』比爾A+幼兒營養穀奶(900g/罐)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '『美好人生』紅豆紅棗八寶飲粉(600g/2罐)【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '去味大師竹木香-淡雅茉莉【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'Alpecin 咖啡因洗髮露 250ML【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': 'GATSBY 造型髮雕霜(強黏性) 200g【屈臣氏】'}
2021-11-28 15:47:49 [scrapy.core.scraper] DEBUG: Scraped from <200 https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F>
{'product': '屈臣氏圓線護理牙線棒50支4盒'}
2021-11-28 15:47:49 [scrapy.core.engine] INFO: Closing spider (finished)
2021-11-28 15:47:49 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 341,
 'downloader/request_count': 1,
 'downloader/request_method_count/GET': 1,
 'downloader/response_bytes': 60279,
 'downloader/response_count': 1,
 'downloader/response_status_count/200': 1,
 'elapsed_time_seconds': 1.335299,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2021, 11, 28, 9, 47, 49, 895142),
 'httpcompression/response_bytes': 800701,
 'httpcompression/response_count': 1,
 'item_scraped_count': 60,

             

InvalidArgumentException: Message: invalid argument: 'url' must be a string invoking url using get()

copy iconCopydownload iconDownload
format(str(i))
for i in range(1,2): # Iterate from page 1 to the last page
    browser.get("https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F&pg={}".format(str(i)))
-----------------------
format(str(i))
for i in range(1,2): # Iterate from page 1 to the last page
    browser.get("https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F&pg={}".format(str(i)))

Could't get &quot;href&quot; in other pages

copy iconCopydownload iconDownload
//ul[@class='gridList']/li/a
ul.gridList > li > a
# Imports Required
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver,30)

for i in range(1,5): # Iterate from page 1 to 4
    driver.get("https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F&pg={}".format(i))
    
    # Wait Until the product appear
    wait.until(EC.presence_of_element_located((By.XPATH,"//ul[@class='gridList']")))

    # Get the products
    product_links = driver.find_elements(By.XPATH,"//ul[@class='gridList']/li/a")

    # Iterate over 'product_links' to get all the 'href' values
    for j,link in zip(range(len(product_links)),product_links):
        print(f"{j} : {link.get_attribute('href')}")
-----------------------
//ul[@class='gridList']/li/a
ul.gridList > li > a
# Imports Required
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver,30)

for i in range(1,5): # Iterate from page 1 to 4
    driver.get("https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F&pg={}".format(i))
    
    # Wait Until the product appear
    wait.until(EC.presence_of_element_located((By.XPATH,"//ul[@class='gridList']")))

    # Get the products
    product_links = driver.find_elements(By.XPATH,"//ul[@class='gridList']/li/a")

    # Iterate over 'product_links' to get all the 'href' values
    for j,link in zip(range(len(product_links)),product_links):
        print(f"{j} : {link.get_attribute('href')}")
-----------------------
//ul[@class='gridList']/li/a
ul.gridList > li > a
# Imports Required
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver,30)

for i in range(1,5): # Iterate from page 1 to 4
    driver.get("https://tw.mall.yahoo.com/search/product?p=%E5%B1%88%E8%87%A3%E6%B0%8F&pg={}".format(i))
    
    # Wait Until the product appear
    wait.until(EC.presence_of_element_located((By.XPATH,"//ul[@class='gridList']")))

    # Get the products
    product_links = driver.find_elements(By.XPATH,"//ul[@class='gridList']/li/a")

    # Iterate over 'product_links' to get all the 'href' values
    for j,link in zip(range(len(product_links)),product_links):
        print(f"{j} : {link.get_attribute('href')}")

Couldn’t get all links by python

copy iconCopydownload iconDownload
# Imports Required

from selenium import webdriver
from selenium.webdriver.common.by import By

driver.get("https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons")

links = driver.find_elements(By.XPATH,"//section[contains(@class,'MainListing__StoreBoothWrap')]/div/div/div/ul/li/a")
print(len(links))

for link in links:
    print(link.get_attribute("href"))
60
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p0330221397264
https://tw.mall.yahoo.com/item/p0330201617111
...
-----------------------
# Imports Required

from selenium import webdriver
from selenium.webdriver.common.by import By

driver.get("https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons")

links = driver.find_elements(By.XPATH,"//section[contains(@class,'MainListing__StoreBoothWrap')]/div/div/div/ul/li/a")
print(len(links))

for link in links:
    print(link.get_attribute("href"))
60
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p0330221397264
https://tw.mall.yahoo.com/item/p0330201617111
...

Community Discussions

Trending Discussions on mall
  • Set rows to datagrid React
  • How to fix &quot;LateInitializationError: Field 'data' has not been initialized error&quot;
  • Flag geocoding errors in R using the ggmap package
  • How to transform scraping results into dict to create data frame?
  • Android Null Pointer Exception 2 Fragments 1 Activity?
  • Android App - Error Crashing - ListView SetAdapter
  • Escaping json parsed from html using node-html-parser
  • scrapy : spider not found (name or get no data ? )
  • InvalidArgumentException: Message: invalid argument: 'url' must be a string invoking url using get()
  • Could't get &quot;href&quot; in other pages
Trending Discussions on mall

QUESTION

Set rows to datagrid React

Asked 2022-Apr-12 at 11:07

I have component where I get data from back end and try to set to DataGrid

Here is it's code

     export const CompaniesHouseContainer: React.FC<Props> = () => {
      const classes = useStyles();
      const companyHouseDataAccess = useCompaniesHouseDataAccess();
      const [loadingCH, setLoadingCH] = useState(false);
      const [companiesHouseResults, setComponentHouseResults] = useState<CompaniesHouseTestDto[]>();
      const companyName = useRef<any>();
      const postalCode = useRef<any>();
      let rows: any[] = [];
      const columns = [
        { field: 'companyName', headerName: 'Company Name', width: 70 },
        { field: 'addressLine1', headerName: 'Address Line 1', width: 130 },
        { field: 'addressLine2', headerName: 'Address Line 1', width: 130 },
        {
          field: 'city',
          headerName: 'City',
          width: 90,
        },
        {
          field: 'postalCode',
          headerName: 'Postal Code',
          width: 160,
        },
      ];
    
      const handleSubmitForm = async (e: any) => {
        e.preventDefault();
        setLoadingCH(true);
        const data = await companyHouseDataAccess.getCompaniesHouseResult(companyName.current.value, postalCode.current.value);
    
        console.log(rows);
        setComponentHouseResults(data);
        setLoadingCH(false);
        rows = data;
        console.log('Here is rows');
        console.log(rows);
      };
    
      return (
        <div className="flex-grow flex flex-col min-h-0">
          <div className="flex-grow flex flex-col min-h-0">
            <div className="pr-0 mt-80" style={{ display: 'flex', justifyContent: 'center' }}>
              <MuiCardWithAnimation component={AnimateSimple} recipe="slideRightInLarge" style={{ width: '70%' }} square>
                <CardContent className="flex flex-col items-center justify-center p-32 md:p-48 md:pt-128 ">
                  <Typography variant="h6" className="md:w-full mb-32">
                    Search Company
                  </Typography>
    
                  <form name="recoverForm" onSubmit={handleSubmitForm} noValidate className="flex flex-col justify-center w-full">
                    <TextField
                      variant="outlined"
                      label="Company Name"
                      className="mb-16"
                      type="text"
                      name="companyName"
                      inputRef={companyName}
                      style={{ marginTop: '50px' }}
                      required
                    />
    
                    <TextField
                      variant="outlined"
                      label="Postal Code"
                      className="mb-16"
                      type="text"
                      name="postalCode"
                      style={{ marginTop: '50px' }}
                      inputRef={postalCode}
                      required
                    />
    
                    <Button
                      variant="contained"
                      color="primary"
                      className="w-224 mx-auto mt-16"
                      aria-label="Reset"
                      style={{ marginTop: '30px' }}
                      type="submit"
                    >
                      SUBMIT
                    </Button>
                  </form>
                </CardContent>
              </MuiCardWithAnimation>
            </div>
          </div>
    
          <div className="flex-grow flex flex-col min-h-0">
            <div className="pr-0 mt-20" style={{ display: 'flex', justifyContent: 'center', overflowY: 'scroll' }}>
              <div style={{ height: 400, width: '100%' }}>
                <DataGridPro rows={rows} columns={columns} pageSize={5} rowsPerPageOptions={[5]} checkboxSelection />
              </div>
            </div>
          </div>
        </div>
);
};

Here I try to populate rows with data coming from BE rows = data;

Here is data that coming from BE

[
{
    "companyName": "N LEDNER CARPENTRY & JOINERY LTD",
    "companyNumber": "10603985",
    "companyStatus": "active",
    "companyType": "ltd",
    "kind": "searchresults#company",
    "companyProfileLink": "https://find-and-update.company-information.service.gov.uk//company/10603985",
    "addressLine1": "38 Derby Drive",
    "addressLine2": "Leybourne",
    "country": "United Kingdom",
    "locality": "West Malling",
    "postalCode": "ME19 5FJ",
    "region": "Kent",
    "sicCodes": null,
    "matchConfidenceBand": "UNMATCHED",
    "matchConfidenceScore": 6,
    "matchConfidenceStrategyName": "FuzzyCompanyNameStrategy"
},
{
    "companyName": "N LEDNER CARPENTRY & JOINERY LTD",
    "companyNumber": "10603985",
    "companyStatus": "active",
    "companyType": "ltd",
    "kind": "searchresults#company",
    "companyProfileLink": "https://find-and-update.company-information.service.gov.uk//company/10603985",
    "addressLine1": "38 Derby Drive",
    "addressLine2": "Leybourne",
    "country": "United Kingdom",
    "locality": "West Malling",
    "postalCode": "ME19 5FJ",
    "region": "Kent",
    "sicCodes": null,
    "matchConfidenceBand": "UNMATCHED",
    "matchConfidenceScore": 4,
    "matchConfidenceStrategyName": "FuzzyNameStrictAddressStrategy"
},
{
    "companyName": "N LEDNER CARPENTRY & JOINERY LTD",
    "companyNumber": "10603985",
    "companyStatus": "active",
    "companyType": "ltd",
    "kind": "searchresults#company",
    "companyProfileLink": "https://find-and-update.company-information.service.gov.uk//company/10603985",
    "addressLine1": "38 Derby Drive",
    "addressLine2": "Leybourne",
    "country": "United Kingdom",
    "locality": "West Malling",
    "postalCode": "ME19 5FJ",
    "region": "Kent",
    "sicCodes": null,
    "matchConfidenceBand": "UNMATCHED",
    "matchConfidenceScore": 60,
    "matchConfidenceStrategyName": "OrderMatchingStrategy"
},
{
    "companyName": "LEDNERAL LTD",
    "companyNumber": "10471091",
    "companyStatus": "dissolved",
    "companyType": "ltd",
    "kind": "searchresults#company",
    "companyProfileLink": "https://find-and-update.company-information.service.gov.uk//company/10471091",
    "addressLine1": "Abergele Road",
    "addressLine2": null,
    "country": null,
    "locality": "Colwyn Bay",
    "postalCode": "LL29 8BF",
    "region": "Conwy",
    "sicCodes": null,
    "matchConfidenceBand": "UNMATCHED",
    "matchConfidenceScore": 12,
    "matchConfidenceStrategyName": "FuzzyCompanyNameStrategy"
},
{
    "companyName": "LEDNERAL LTD",
    "companyNumber": "10471091",
    "companyStatus": "dissolved",
    "companyType": "ltd",
    "kind": "searchresults#company",
    "companyProfileLink": "https://find-and-update.company-information.service.gov.uk//company/10471091",
    "addressLine1": "Abergele Road",
    "addressLine2": null,
    "country": null,
    "locality": "Colwyn Bay",
    "postalCode": "LL29 8BF",
    "region": "Conwy",
    "sicCodes": null,
    "matchConfidenceBand": "UNMATCHED",
    "matchConfidenceScore": 9,
    "matchConfidenceStrategyName": "FuzzyNameStrictAddressStrategy"
},
{
    "companyName": "LEDNERAL LTD",
    "companyNumber": "10471091",
    "companyStatus": "dissolved",
    "companyType": "ltd",
    "kind": "searchresults#company",
    "companyProfileLink": "https://find-and-update.company-information.service.gov.uk//company/10471091",
    "addressLine1": "Abergele Road",
    "addressLine2": null,
    "country": null,
    "locality": "Colwyn Bay",
    "postalCode": "LL29 8BF",
    "region": "Conwy",
    "sicCodes": null,
    "matchConfidenceBand": "UNMATCHED",
    "matchConfidenceScore": 30,
    "matchConfidenceStrategyName": "OrderMatchingStrategy"
}

]

I see table rendered, but no rows

enter image description here

Where can be problem?

ANSWER

Answered 2022-Apr-12 at 11:07

Updating a constant will not trigger any rerender of your component. So you need to store the rows in a local state:

Instead of :

  let rows: any[] = [];

You should have:

const [rows,setRows] = useState<any[]>([])

Source https://stackoverflow.com/questions/71830218

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install mall

You can download it from GitHub.
You can use mall like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the mall component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Consider Popular Microservice Libraries
Compare Microservice Libraries with Highest Support
Compare Microservice Libraries with Highest Security
Compare Microservice Libraries with Permissive License
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.