Jacobvu84 / selenium-vietnam-training-course

Questions Tracking
7 stars 5 forks source link

Get Xpath in Table (tr/td/span) ? #16

Closed nguyendinhthuan789 closed 6 years ago

nguyendinhthuan789 commented 6 years ago

I cannot get xpath with image below, please help me. Tks 46a4f4125dac5bc27418b923a8af4d6f81248f2c833f55a0b4 pimgpsh_fullsize_distr

Jacobvu84 commented 6 years ago

@nguyendinhthuan789 Em đếm xem cái xpath đó bằng mấy. Anh e rằng xpath kiểu này sẽ tồn tại nhiều hơn một giá trị.

Thay vào đó em nên lấy theo text: Phần tiếng Nhật em copy bị cái text bên phải vào.

Ví dụ: //th[text()=' tiếng nhật bó tay luôn']/following-sibling::td/span

nguyendinhthuan789 commented 6 years ago

@vuthelinh : em thử theo cách của anh thì ntn : //th[text()='税抜価格']/following-sibling::td/span em run nó miss

Jacobvu84 commented 6 years ago

Vấn đề nó không nằm ở việc locate element nữa. Debug chạy chậm lại kịch bản để tìm nguyên nhân