With the popularity of the network, the influence of web search activity on capital market has become a central issue in finance. Although a growing body of literature finds that the online search volume helps to explain stock trading activities, few studies take the impacts of market states into account. To fill up the gap, this study explores the influence of market states on the relationship between web search activity and capital market from the perspective of stock returns. The evidence shows that web search activity proxied by the weekly Google search volume drives stock returns in the regular and up market states, although investors exhibit the same behavior to search for information via the Internet across time. The results generally support the attention effect of online search activity on stock returns. However, the reluctance to buy stocks in the bearish market due to the fear of bearing substantial systematic risks may limit the attention effect and weaken the link between web search activity and stock returns.