VEVO (visa)
Project:
Ezy.Module.Selenium.Search.ShareFile chính:Selenium/VevoSelenium.cs(Selenium ChromeDriver thuần)
Tra cứu trạng thái visa qua VEVO (Visa Entitlement Verification Online) và tải PDF kết quả. Module này nằm trong Share (không phải project riêng), được gọi bởi engine TextSearch_SeleniumEngine.
Nguồn
- Site:
online.immi.gov.au.
Input (hai tầng)
Hàng đợi TextSearch_SeleniumQueue (engine lọc !IsRun và SeleniumType == "TextSearch_Vevo"): dùng ItemId, PDFs (JSON mảng path, lấy path đầu), FolderPath; set lại DataId, IsRun.
Bản ghi gốc TextSearch_Vevo (repo.GetById(item.ItemId)):
| Cột | Vai trò |
|---|---|
DocumentNumber | Số hộ chiếu/giấy tờ |
FamilyName / GivenName | Họ / tên |
DOB | Ngày sinh |
CountryOfDocument | Quốc gia cấp giấy tờ (SelectByValue) |
TextSearch_Data | Liên kết bản ghi data |
DocumentType cố định "01" (passport) trong code, không lấy từ DB.
Login / Captcha
- Có login (
Login()): điền#username,#password, clickname=login, rồiname=continuenếu có. - Credential từ file:
Configs/VevoSearch.json→ classVevoSeleniumSettingModel(Username/Password). - Không xử lý captcha.
Các bước scrape (SearchItem)
OpenChrome: ChromeDriver,--no-sandbox, setdownload.default_directory= thư mụcPDFcạnh app; kill chromedriver mồ côi nếu lỗi.Login(setting).- Click clear
#_1a0a-body. - Chọn DocumentType:
SelectByValue("01")(re-fetch sau reload). - Điền: DocumentNumber, FamilyName, GivenName (nếu có), DOB,
SelectByValue(CountryOfDocument), tick checkbox điều khoản. - Submit form.
- Click download; so sánh file mới trong thư mục download (before/after);
File.CopysangfilePath, xoá file tạm. - Bóc text kết quả qua
GetHtmlText(id)(.wc-input): FamilyName, GivenName, DocumentNumber, VisaClass_Subclass, VisaApplicant, Location, VisaType. CloseChrome.
Output
Entity TextSearch_Data_Vevo. Upsert: nếu TextSearch_Vevo.TextSearch_Data parse ra Id>0 thì update, ngược lại Insert. Key fields: PdfURLs (JSON, đã strip FolderPath), FamilyName, GivenName, DocumentNumber, VisaClass_Subclass, VisaApplicant, Location, VisaType. Output chính là PDF (không screenshot trong flow này).
Lỗi / edge cases
:::warning Nuốt exception
Toàn bộ SearchItem bọc try/catch rỗng → lỗi bị nuốt, trả null (không ghi SearchStatus/log ở đây). Đây là điểm yếu đáng lưu ý.
:::
- Download button null → bỏ qua, không lưu data.
- File tải không tồn tại → bỏ qua ghi DB.
OpenChromelỗi →KillOrphanedChromeDriverProcesses;CloseChromecatch rỗng.ChromeIsOpened/DriveIsRunningkiểm tra driver còn sống trước khi thao tác.
Trạng thái: active.