## weekend project : 1/12

### A.What's the workflow?
**Getting information of 1 product on a webpage. (Tittle, price, ID, url, url img…)**

- **How do we do it?**
=> Using web scraping function, crawling data.
- **Project Purpose**
=> Getting data to analyze.
- **Project Requirement**
=> Infomation of product from catalogue in tiki.vn
- **Which tools need for this project?**
=> Python, VS Code, Jupyter Notebook, Conda Env
## Problem solve :
1. How to get infomation of one product => using BS4, dict, pandas
2. How to append them to 1 df => using Dictionary to loop and save the "Value" of it into "Key".
3. Then, find a way to loop all the products on that single page.
4. Collect (append) them to 1 DataFrame (of a single page)
5. What if products from other catagories had different shape of info? => using **"try"** and **"except"** to loop through them.
6. Find a way to automatically loop to all the pages.
7. How many **pages** of products if you dont care and lazy to figure out? => using a **function** to check the final page first.
8. Anything else? Yup, dont forget using **sleep()** for disblock access from TIKI.VN
## Explain:
Look at one product in one single page:

The elements that we need is already here ('class':'product-item')

So, with *n* pages, we need to find out how many pages?

Using a function to check, with the end depend on number of items there (len(product)):

Then we need to used both function to check and crawling:

And save them into a CSV file has name of product.

Printout the dataFrame, we got this.

## Example & Note:
#### 1. Different products has different values and structure & elements.
**BOOKS vs Electrics Devices:**


**So, writing a function to looping through all of product we need to use Try and Except for more optional**

#### 2. Using #sleep for more "HUMAN".

#### 3. Check the final result.
- Remember to check the index of item & page from CSV files.
- And check for if any duplicated product.
