GithubHelp home page GithubHelp logo

data_japan's Introduction

Cách bổ sung code vào các file

hệ thống dùng selenium 4.10.0 nên sẽ không cần path của chromedriver nữa, mọi người update selenium nếu cần, sửa đoạn khởi tạo driver trong code sử dụng selenium của mình

  • File Crawl/base/URL.py :

    • bổ sung các link vào dict với vai trò tương ứng (nếu ko có thì để trống), trong link, sửa các giá trị dùng để replace khi tạo link (ví dụ SYMBOL, STARTDATE, ENĐATE, trong đó lần lượt là mã công ty, ngày bắt đầu lấy dữ liệu, ngày cuối cùng lấy dữ liệu)
    • Các hằng số phụ khác để như PATH_SAVE (nếu có)
  • File Crawl/base/setup.py :

    • lưu các chức năng có thể sử dụng khi lấy dữ liệu ở các nguồn khác nhau. Các function trong này có khả năng sử dụng ở nhiều tình huống chứ không phải 1 tình huống cụ thể trên 1 nguồn dữ liệu. Có thể là function để check_list, save, ...
  • Các file trong thư mục Crawl nhưng ngoài thư mục base:

    • Mỗi file xử lí cho 1 nguồn dữ liệu
    • Tạo một class (lấy tên là nguồn dữ liệu) và chuyển đổi các chức năng hiện tại (crawl, filter, getListCompany, ...) thành các method của class
  • Comment chức năng mỗi hàm trong chương trình của mình, ví dụ như sau:

      def saveDataFrameCSV(self, dataframe, file_name):
          '''
          save dataframe to csv file
          '''
          try:
              dataframe.to_csv(f"{self.path_save}/{file_name}.csv", index= False)
          except:
              # raise Exception("Can't save file")
              print("Can't save file")
              pass
    

    thì "save dataframe to csv file" là mô tả về hàm

data_japan's People

Contributors

hieublack avatar anh26535d avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.