Rate adaptation (RA) is used in IEEE 802.11 WLANs to determine the optimal datarate for a particular channel condition. It becomes especially difficult to determine the optimal datarate for the new High-Throughput WLANs (802.11ac/ax) since the number of available datarates in these standards are very high. Moreover, a mobile environment poses additional challenge in RA as the channel conditions will keep on changing from time to time. In this paper, we propose a Contextual Bandits based Rate Adaptation (ContRA) algorithm for mobile users in IEEE 802.11ac/ax standards. Based on the Received Signal Strength Indicator (RSSI) range that the receiver is currently in, the RA algorithm tries to determine the optimal rate from the rate set suitable for packet transmission in that RSSI range. Performance studies show that the proposed RA algorithm is able to adapt to changing channel conditions and quickly choose a suitable datarate for those channel conditions.