In this paper, the problem of opportunistic channel sensing and access in cognitive radio networks when the sensing is imperfect and a secondary user has limited traffic to send at a time is investigated. Primary users' statistical information is assumed to be unknown, and therefore, a secondary user needs to learn the information online during channel sensing and access process, which means learning loss, also referred to as regret, is inevitable. In this research, the case when all potential channels can be sensed simultaneously is investigated first. The channel access process is modeled as a multi-armed bandit problem with side observation. And channel access rules are derived and theoretically proved to have asymptotically finite regret. Then the case when the secondary user can sense only a limited number of channels at a time is investigated. The channel sensing and access process is modeled as a bi-level multi-armed bandit problem. It is shown that any adaptive rule has at least logarithmic regret. Then we derive channel sensing and access rules and theoretically prove they have logarithmic regret asymptotically and with finite time. The effectiveness of the derived rules is validated by computer simulation.