CoreLogic
Project:
Ezy.Module.Selenium.Search.CoreLogicFile chính:CoreLogicWebBrowser.cs(+CoreLogicWebBrowserHelper.cs)
Module làm giàu dữ liệu (MoreInfo) cho bất động sản trên CoreLogic. Dùng EO.WebBrowser nhúng trong WinForm (không phải Selenium ChromeDriver), đăng nhập qua OAuth.
Nguồn
- Site:
rpp.corelogic.com.au. - Trang OAuth:
auth.corelogic.asia/as/authorization.oauth2?....
Input
Đọc hàng đợi TextSearch_MoreInfo_Queue, lọc IsSearch == false và Type == "TextSearch_CoreLogic_Asia_RP".
| Cột | Vai trò |
|---|---|
Url | URL khởi tạo nạp vào browser |
TextSearch_Data_Id | Chuỗi split('_') thành 3 phần: [0] = PK của TextSearch_CoreLogic_Asia_RP, [1] = username, [2] = password |
IsSearch | Cờ hoàn tất |
SearchStatus | Ghi lỗi |
Địa chỉ tra cứu lấy từ TextSearch_CoreLogic_Asia_RP.Name.
Login
- Form login OAuth thực hiện bằng JavaScript injection trên
auth.corelogic.asia: điền#username,#password, click#signOnButtonquawebView.EvalScript(...). - Credential KHÔNG hardcode — đến từ
TextSearch_MoreInfo_Queue.TextSearch_Data_Id(phần[1]/[2]) lưu trong DB.
Quan hệ với AutoLoad (giữ phiên sống)
Module riêng AutoLoad chạy ChromeDriver thật, đăng nhập CoreLogic định kỳ (mặc định 5 phút — ReloadIntervalMinutes), giữ phiên sống và xuất cookie (APP2SESSION-XSRF, APP2SESSION) ra Cookies.json, gửi qua UDP socket với message CoreLogic_{path}. Credential của AutoLoad nằm trong Configs/AutoLoadConfig.json (key UserName/Password).
Các bước scrape
StartSearchMoreInfo(item):RefreshCache(), nạpitem.Url, chờ tối đa 60s tới khiIsSearch.- Mỗi lần trang nạp xong → handler
WebView_LoadCompleted. - Nếu URL là trang OAuth → inject login.
- Nếu URL ==
rpp.corelogic.com.au→ đọc#crux-home-greetingxác nhận đã đăng nhập. - Truy DB lấy
TextSearch_CoreLogic_Asia_RPtheo[0]; chuẩn hóaName(bỏ "Australia", dấu phẩy) thànhaddress. - Gọi API gợi ý:
rpp.corelogic.com.au/api/clapi/suggestions?limit=1&q={address}&suggestionTypes=address. - Trích
propertyIdtừ HTML bằng regexpropertyId":[0-9]*.
Output
Đọc/ghi entity TextSearch_CoreLogic_Asia_RP. Nhánh xử lý hiện dừng ở bước lấy propertyId (không có screenshot/PDF trong module này).
Lỗi / edge cases
isFailed = true→ setIsSearch = truethoát ngay.TextSearch_Data_Idkhông tách đủ 3 phần →isFailed.Namerỗng / không tìm thấy bản ghi →isFailed.- Exception →
SearchStatus = GetException(ex)+IsSearch = true. - Timeout chờ kết quả: 60s.
StartSearchMoreInfobọc tronglock(_object)→ chạy tuần tự. Hết hạn phiên xử lý gián tiếp qua AutoLoad.
Trạng thái: active (phụ thuộc AutoLoad giữ phiên).