We present a novel ranking loss based Multiple Instance Learning (rankMIL) method which uses the routine H&E-stained slide images to predict the human papillomavirus (HPV) infection status of head and neck cancer patients. Experiments were conducted on the publicly available TCGA-HNSC cohort and the proposed method achieved the new state-of-the-art performance (AUC=0.92) compared to previous methods.